diff options
-rw-r--r-- | openstack/common/rpc/impl_zmq.py | 2 | ||||
-rw-r--r-- | tests/unit/rpc/common.py | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/openstack/common/rpc/impl_zmq.py b/openstack/common/rpc/impl_zmq.py index 13f5fca..f408165 100644 --- a/openstack/common/rpc/impl_zmq.py +++ b/openstack/common/rpc/impl_zmq.py @@ -750,7 +750,7 @@ def _multi_send(method, context, topic, msg, timeout=None, LOG.warn(_("No matchmaker results. Not casting.")) # While not strictly a timeout, callers know how to handle # this exception and a timeout isn't too big a lie. - raise rpc_common.Timeout, "No match from matchmaker." + raise rpc_common.Timeout(_("No match from matchmaker.")) # This supports brokerless fanout (addresses > 1) for queue in queues: diff --git a/tests/unit/rpc/common.py b/tests/unit/rpc/common.py index 5a2af19..c4362b2 100644 --- a/tests/unit/rpc/common.py +++ b/tests/unit/rpc/common.py @@ -24,12 +24,10 @@ import time import datetime import eventlet -from eventlet import greenthread from oslo.config import cfg from openstack.common import exception from openstack.common.gettextutils import _ -from openstack.common import jsonutils from openstack.common.rpc import common as rpc_common from openstack.common.rpc import dispatcher as rpc_dispatcher from tests import utils as test_utils @@ -231,10 +229,10 @@ class BaseRpcTestCase(test_utils.BaseTestCase): self.assertEqual(value, result) def test_call_timeout(self): + """Make sure rpc.call will time out.""" if not self.rpc: self.skipTest('rpc driver not available.') - """Make sure rpc.call will time out.""" if not self.supports_timeouts: self.skipTest(_("RPC backend does not support timeouts")) @@ -252,7 +250,7 @@ class BaseRpcTestCase(test_utils.BaseTestCase): "args": {"value": value}}, timeout=1) self.fail("should have thrown Timeout") - except rpc_common.Timeout as exc: + except rpc_common.Timeout: pass def test_multithreaded_resp_routing(self): @@ -295,7 +293,7 @@ def rpc_wrapper(callid, func, *args): """ try: ret = func(*args) - except rpc_common.Timeout as exc: + except rpc_common.Timeout: synced_echo_call.wait(callid) ret = None return ret |