diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-03-22 16:49:20 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-03-22 16:49:20 +0000 |
commit | a69e6b873e157adb9e214d01dc8952a7589be366 (patch) | |
tree | 328d63600c5ceda593d4a8814b107e3001ad4168 /openstack/common/rpc/impl_zmq.py | |
parent | f48e798f0e10a657a52896b2237243c4b93e7f3c (diff) | |
parent | 85e9e0622c96a3d2e0237e7a7bf089a1343ef545 (diff) | |
download | oslo-a69e6b873e157adb9e214d01dc8952a7589be366.tar.gz oslo-a69e6b873e157adb9e214d01dc8952a7589be366.tar.xz oslo-a69e6b873e157adb9e214d01dc8952a7589be366.zip |
Merge "Eliminate multiple contexts in zmq call()"
Diffstat (limited to 'openstack/common/rpc/impl_zmq.py')
-rw-r--r-- | openstack/common/rpc/impl_zmq.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/openstack/common/rpc/impl_zmq.py b/openstack/common/rpc/impl_zmq.py index f7a59a2..3fe45f5 100644 --- a/openstack/common/rpc/impl_zmq.py +++ b/openstack/common/rpc/impl_zmq.py @@ -295,11 +295,16 @@ class InternalContext(object): def reply(self, ctx, proxy, msg_id=None, context=None, topic=None, msg=None): """Reply to a casted call.""" - # Our real method is curried into msg['args'] + # NOTE(ewindisch): context kwarg exists for Grizzly compat. + # this may be able to be removed earlier than + # 'I' if ConsumerBase.process were refactored. + if type(msg) is list: + payload = msg[-1] + else: + payload = msg - child_ctx = RpcContext.unmarshal(msg[0]) response = ConsumerBase.normalize_reply( - self._get_response(child_ctx, proxy, topic, msg[1]), + self._get_response(ctx, proxy, topic, payload), ctx.replies) LOG.debug(_("Sending reply")) @@ -685,8 +690,8 @@ def _call(addr, context, topic, msg, timeout=None, 'method': '-reply', 'args': { 'msg_id': msg_id, - 'context': mcontext, 'topic': reply_topic, + # TODO(ewindisch): safe to remove mcontext in I. 'msg': [mcontext, msg] } } |