summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc/common.py
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-12-13 12:53:43 -0500
committerRussell Bryant <rbryant@redhat.com>2013-01-03 14:02:09 -0500
commitadffcd58fb09dafb0c4e128797b4a61a59087f9a (patch)
treeafcbabee9561afb0fbc56ef2dafe6288c107ca01 /openstack/common/rpc/common.py
parentfdc74c07d63ff897f42405b6dde0ffa46d6e26c3 (diff)
downloadoslo-adffcd58fb09dafb0c4e128797b4a61a59087f9a.tar.gz
oslo-adffcd58fb09dafb0c4e128797b4a61a59087f9a.tar.xz
oslo-adffcd58fb09dafb0c4e128797b4a61a59087f9a.zip
Optionally add message envelope to notifications.
When message envelopes were added for rpc messages, notifications were explicitly left out. This was due to the fact that notifications are consumed outside of OpenStack. However, notification consumers will likely want to eventually start taking advantage of some of the features that the envelope is a prerequisite for, such as message signing. This patch adds a new notification driver that produces message based notifications including the message envelope. Related to blueprint version-rpc-messages. Change-Id: Iaa8b437e6b4f64053f4b02bf486516f60bb020e9
Diffstat (limited to 'openstack/common/rpc/common.py')
-rw-r--r--openstack/common/rpc/common.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/openstack/common/rpc/common.py b/openstack/common/rpc/common.py
index a3a3699..86aa986 100644
--- a/openstack/common/rpc/common.py
+++ b/openstack/common/rpc/common.py
@@ -408,8 +408,8 @@ def version_is_compatible(imp_version, version):
return True
-def serialize_msg(raw_msg):
- if not _SEND_RPC_ENVELOPE:
+def serialize_msg(raw_msg, force_envelope=False):
+ if not _SEND_RPC_ENVELOPE and not force_envelope:
return raw_msg
# NOTE(russellb) See the docstring for _RPC_ENVELOPE_VERSION for more
@@ -436,8 +436,8 @@ def deserialize_msg(msg):
# If so, great!
#
# b) If it doesn't look like a standard message envelope, it could either
- # be a notification (which we don't wrap), or a message from before
- # we added a message envelope (referred to as version 1.0).
+ # be a notification, or a message from before we added a message
+ # envelope (referred to as version 1.0).
# Just return the message as-is.
#
# 2) It's any other non-dict type. Just return it and hope for the best.