diff options
author | Gevorg Davoian <gdavoian@mirantis.com> | 2016-04-25 15:42:12 +0300 |
---|---|---|
committer | Gevorg Davoian <gdavoian@mirantis.com> | 2016-05-18 11:42:07 +0300 |
commit | 32a7c1c0a458f589e2710525e03630f00b538cda (patch) | |
tree | 515229fb6b1931f02db637f66fc3538c479e641e /oslo_messaging/_utils.py | |
parent | 3158d483f44ff49b15c42fca4fe13e27258a8480 (diff) | |
download | oslo-messaging-32a7c1c0a458f589e2710525e03630f00b538cda.tar.gz |
Fix bug with version_cap and target.version in RPCClient
This patch fixes the bug in the RPCClient class when a client's
version_cap is set, but target.version is unset. The code does not
check this case, which results in unhandled exceptions.
Change-Id: I623c14b74b9101bb4ab199dff6609fab44388c4a
Closes-Bug: 1574615
Diffstat (limited to 'oslo_messaging/_utils.py')
-rw-r--r-- | oslo_messaging/_utils.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/oslo_messaging/_utils.py b/oslo_messaging/_utils.py index e0025e6..da0012a 100644 --- a/oslo_messaging/_utils.py +++ b/oslo_messaging/_utils.py @@ -22,6 +22,12 @@ def version_is_compatible(imp_version, version): :param imp_version: The version implemented :param version: The version requested by an incoming message. """ + if imp_version is None: + return True + + if version is None: + return False + version_parts = version.split('.') imp_version_parts = imp_version.split('.') try: |