Merge "Missing version parameter in can_send_version()"

This commit is contained in:
Jenkins 2016-03-17 07:06:01 +00:00 committed by Gerrit Code Review
commit f0d251d19d
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()