diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-07-15 19:31:53 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-07-15 19:31:53 +0000 |
| commit | 562d8ce6b8eecb0587ae2dd85a30ae72312b57b0 (patch) | |
| tree | 21f7e4912d74e0162f22d501b4e39c6033c2a946 /openstack/common | |
| parent | 80f92cf1161fbecf6e5a3a98f29a296b9412a6dd (diff) | |
| parent | 7bfd4439fe48e861675e3930486b55f8badd072e (diff) | |
| download | oslo-562d8ce6b8eecb0587ae2dd85a30ae72312b57b0.tar.gz oslo-562d8ce6b8eecb0587ae2dd85a30ae72312b57b0.tar.xz oslo-562d8ce6b8eecb0587ae2dd85a30ae72312b57b0.zip | |
Merge "Avoid shadowing Exception 'message' attribute"
Diffstat (limited to 'openstack/common')
| -rw-r--r-- | openstack/common/rpc/common.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/openstack/common/rpc/common.py b/openstack/common/rpc/common.py index 0d85488..45bd7a8 100644 --- a/openstack/common/rpc/common.py +++ b/openstack/common/rpc/common.py @@ -74,14 +74,14 @@ _REMOTE_POSTFIX = '_Remote' class RPCException(Exception): - message = _("An unknown RPC related exception occurred.") + msg_fmt = _("An unknown RPC related exception occurred.") def __init__(self, message=None, **kwargs): self.kwargs = kwargs if not message: try: - message = self.message % kwargs + message = self.msg_fmt % kwargs except Exception: # kwargs doesn't match a variable in the message @@ -90,7 +90,7 @@ class RPCException(Exception): for name, value in kwargs.iteritems(): LOG.error("%s: %s" % (name, value)) # at least get the core message out if something happened - message = self.message + message = self.msg_fmt super(RPCException, self).__init__(message) @@ -104,7 +104,7 @@ class RemoteError(RPCException): contains all of the relevant info. """ - message = _("Remote error: %(exc_type)s %(value)s\n%(traceback)s.") + msg_fmt = _("Remote error: %(exc_type)s %(value)s\n%(traceback)s.") def __init__(self, exc_type=None, value=None, traceback=None): self.exc_type = exc_type @@ -121,7 +121,7 @@ class Timeout(RPCException): This exception is raised if the rpc_response_timeout is reached while waiting for a response from the remote side. """ - message = _('Timeout while waiting on RPC response - ' + msg_fmt = _('Timeout while waiting on RPC response - ' 'topic: "%(topic)s", RPC method: "%(method)s" ' 'info: "%(info)s"') @@ -144,25 +144,25 @@ class Timeout(RPCException): class DuplicateMessageError(RPCException): - message = _("Found duplicate message(%(msg_id)s). Skipping it.") + msg_fmt = _("Found duplicate message(%(msg_id)s). Skipping it.") class InvalidRPCConnectionReuse(RPCException): - message = _("Invalid reuse of an RPC connection.") + msg_fmt = _("Invalid reuse of an RPC connection.") class UnsupportedRpcVersion(RPCException): - message = _("Specified RPC version, %(version)s, not supported by " + msg_fmt = _("Specified RPC version, %(version)s, not supported by " "this endpoint.") class UnsupportedRpcEnvelopeVersion(RPCException): - message = _("Specified RPC envelope version, %(version)s, " + msg_fmt = _("Specified RPC envelope version, %(version)s, " "not supported by this endpoint.") class RpcVersionCapError(RPCException): - message = _("Specified RPC version cap, %(version_cap)s, is too low") + msg_fmt = _("Specified RPC version cap, %(version_cap)s, is too low") class Connection(object): |
