From 8422e975b3b11a344a3c67e77135ed1ac45564ca Mon Sep 17 00:00:00 2001 From: Corey Wright <corey.wright@rackspace.com> Date: Wed, 24 Jun 2015 16:40:45 -0500 Subject: [PATCH] Correct RPCVersionCapError message This change adjusts the exception message to be more in line with the version compatibility algorithm so as to accurately portray the problem to the log recipient. The RPCVersionCapError message can be grossly incorrect when the requested message's major version is lower than the specified version cap's major version, declaring the requested message version as too high, when the real error is that the major versions differ (as major versions are assumed to be incompatible). Example: RPCVersionCapError: Requested message version, 3.23 is too high. It needs to be lower than the specified version cap 4.0. Change-Id: Iceef999ed385f2ba77449c568127f50f83d47196 Closes-Bug: 1468525 --- oslo_messaging/rpc/client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/oslo_messaging/rpc/client.py b/oslo_messaging/rpc/client.py index 3ea703456..3b05785a2 100644 --- a/oslo_messaging/rpc/client.py +++ b/oslo_messaging/rpc/client.py @@ -63,8 +63,10 @@ class RPCVersionCapError(exceptions.MessagingException): def __init__(self, version, version_cap): self.version = version self.version_cap = version_cap - msg = ("Requested message version, %(version)s is too high. It needs " - "to be lower than the specified version cap %(version_cap)s." % + msg = ("Requested message version, %(version)s is incompatible. It " + "needs to be equal in major version and less than or equal " + "in minor version as the specified version cap " + "%(version_cap)s." % dict(version=self.version, version_cap=self.version_cap)) super(RPCVersionCapError, self).__init__(msg)