From 89bc0e6ef224daa5ca7af85ac6b77532fd0543f8 Mon Sep 17 00:00:00 2001 From: Javeme Date: Wed, 9 Mar 2016 17:58:50 +0800 Subject: [PATCH] Missing version parameter in can_send_version() Change-Id: I1afadaabe908df4d66c94d36539c7380e424c186 Closes-Bug: #1554996 --- oslo_messaging/rpc/client.py | 3 +-- oslo_messaging/tests/rpc/test_client.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/oslo_messaging/rpc/client.py b/oslo_messaging/rpc/client.py index 7beea841e..92886b17b 100644 --- a/oslo_messaging/rpc/client.py +++ b/oslo_messaging/rpc/client.py @@ -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().""" diff --git a/oslo_messaging/tests/rpc/test_client.py b/oslo_messaging/tests/rpc/test_client.py index ebb72324b..197a296c6 100644 --- a/oslo_messaging/tests/rpc/test_client.py +++ b/oslo_messaging/tests/rpc/test_client.py @@ -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()