Missing version parameter in can_send_version()

Change-Id: I1afadaabe908df4d66c94d36539c7380e424c186
Closes-Bug: #1554996
This commit is contained in:
Javeme 2016-03-09 17:58:50 +08:00
parent 8028b4d9fb
commit 89bc0e6ef2
2 changed files with 4 additions and 2 deletions

View File

@ -121,8 +121,7 @@ class _CallContext(object):
"""Check to see if a version is compatible with the version cap."""
version = self.target.version if version is self._marker else version
return (not self.version_cap or
utils.version_is_compatible(self.version_cap,
self.target.version))
utils.version_is_compatible(self.version_cap, version))
def cast(self, ctxt, method, **kwargs):
"""Invoke a method and return immediately. See RPCClient.cast()."""

View File

@ -513,6 +513,9 @@ class TestCanSendVersion(test_utils.BaseTestCase):
if self.can_send_version is not _notset:
can_send = client.can_send_version(version=self.can_send_version)
call_context_can_send = client.prepare().can_send_version(
version=self.can_send_version)
self.assertEqual(can_send, call_context_can_send)
else:
can_send = client.can_send_version()