summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc/__init__.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/__init__.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/__init__.py')
-rw-r--r--openstack/common/rpc/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/openstack/common/rpc/__init__.py b/openstack/common/rpc/__init__.py
index 902cea2..9303505 100644
--- a/openstack/common/rpc/__init__.py
+++ b/openstack/common/rpc/__init__.py
@@ -178,17 +178,18 @@ def multicall(context, topic, msg, timeout=None):
return _get_impl().multicall(cfg.CONF, context, topic, msg, timeout)
-def notify(context, topic, msg):
+def notify(context, topic, msg, envelope=False):
"""Send notification event.
:param context: Information that identifies the user that has made this
request.
:param topic: The topic to send the notification to.
:param msg: This is a dict of content of event.
+ :param envelope: Set to True to enable message envelope for notifications.
:returns: None
"""
- return _get_impl().notify(cfg.CONF, context, topic, msg)
+ return _get_impl().notify(cfg.CONF, context, topic, msg, envelope)
def cleanup():