summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2013-03-21 18:43:36 -0400
committerRussell Bryant <rbryant@redhat.com>2013-03-21 18:43:36 -0400
commitec8465a7b1077a71082324220e7c44cf700a4d4b (patch)
tree32e31f1e4fbdb0a280ef16c0077cba40a2d1919b /openstack/common/rpc
parentbf70726d4228ebf3e65aa75b8f0ca6cab5e1e159 (diff)
downloadoslo-ec8465a7b1077a71082324220e7c44cf700a4d4b.tar.gz
oslo-ec8465a7b1077a71082324220e7c44cf700a4d4b.tar.xz
oslo-ec8465a7b1077a71082324220e7c44cf700a4d4b.zip
Enable message envelope.
Grizzly had the ability to receive messages with an envelope, but did not send them. Now update the code to send them. Change-Id: I73aad7697cf83ad4aabb3c2058b7cc4f53f783c2
Diffstat (limited to 'openstack/common/rpc')
-rw-r--r--openstack/common/rpc/amqp.py2
-rw-r--r--openstack/common/rpc/common.py9
-rw-r--r--openstack/common/rpc/impl_zmq.py2
3 files changed, 3 insertions, 10 deletions
diff --git a/openstack/common/rpc/amqp.py b/openstack/common/rpc/amqp.py
index 2dcb12b..81fb41e 100644
--- a/openstack/common/rpc/amqp.py
+++ b/openstack/common/rpc/amqp.py
@@ -662,7 +662,7 @@ def notify(conf, context, topic, msg, connection_pool, envelope):
pack_context(msg, context)
with ConnectionContext(conf, connection_pool) as conn:
if envelope:
- msg = rpc_common.serialize_msg(msg, force_envelope=True)
+ msg = rpc_common.serialize_msg(msg)
conn.notify_send(topic, msg)
diff --git a/openstack/common/rpc/common.py b/openstack/common/rpc/common.py
index 5661bef..8bffc2b 100644
--- a/openstack/common/rpc/common.py
+++ b/openstack/common/rpc/common.py
@@ -70,10 +70,6 @@ _VERSION_KEY = 'oslo.version'
_MESSAGE_KEY = 'oslo.message'
-# TODO(russellb) Turn this on after Grizzly.
-_SEND_RPC_ENVELOPE = False
-
-
class RPCException(Exception):
message = _("An unknown RPC related exception occurred.")
@@ -441,10 +437,7 @@ def version_is_compatible(imp_version, version):
return True
-def serialize_msg(raw_msg, force_envelope=False):
- if not _SEND_RPC_ENVELOPE and not force_envelope:
- return raw_msg
-
+def serialize_msg(raw_msg):
# NOTE(russellb) See the docstring for _RPC_ENVELOPE_VERSION for more
# information about this format.
msg = {_VERSION_KEY: _RPC_ENVELOPE_VERSION,
diff --git a/openstack/common/rpc/impl_zmq.py b/openstack/common/rpc/impl_zmq.py
index 87f8d21..f7a59a2 100644
--- a/openstack/common/rpc/impl_zmq.py
+++ b/openstack/common/rpc/impl_zmq.py
@@ -221,7 +221,7 @@ class ZmqClient(object):
def cast(self, msg_id, topic, data, envelope=False):
msg_id = msg_id or 0
- if not (envelope or rpc_common._SEND_RPC_ENVELOPE):
+ if not envelope:
self.outq.send(map(bytes,
(msg_id, topic, 'cast', _serialize(data))))
return