From 8abc71039d67f7826bf2abccaf3a5c040243700e Mon Sep 17 00:00:00 2001 From: Victoria Martinez de la Cruz Date: Wed, 31 May 2017 16:19:06 -0300 Subject: [PATCH] Use get_notification_transport for notifications oslo messaging's get_transport is not intended for notifications, we should be using get_notification_transport instead. This patch set adds that change. If settings in manila.conf oslo_messaging_notifications are not set, this will fallback to default configs. Change-Id: Ic65f043086f38d930973ee52ca9ff210e27ece99 Closes-Bug: #1694776 --- manila/rpc.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/manila/rpc.py b/manila/rpc.py index 9fca818ce2..d32f825769 100644 --- a/manila/rpc.py +++ b/manila/rpc.py @@ -35,6 +35,7 @@ import manila.exception CONF = cfg.CONF TRANSPORT = None +NOTIFICATION_TRANSPORT = None NOTIFIER = None ALLOWED_EXMODS = [ @@ -44,13 +45,17 @@ EXTRA_EXMODS = [] def init(conf): - global TRANSPORT, NOTIFIER + global TRANSPORT, NOTIFICATION_TRANSPORT, NOTIFIER exmods = get_allowed_exmods() TRANSPORT = messaging.get_transport(conf, allowed_remote_exmods=exmods) + NOTIFICATION_TRANSPORT = messaging.get_notification_transport( + conf, + allowed_remote_exmods=exmods) serializer = RequestContextSerializer(JsonPayloadSerializer()) - NOTIFIER = messaging.Notifier(TRANSPORT, serializer=serializer) + NOTIFIER = messaging.Notifier(NOTIFICATION_TRANSPORT, + serializer=serializer) def initialized(): @@ -58,11 +63,13 @@ def initialized(): def cleanup(): - global TRANSPORT, NOTIFIER + global TRANSPORT, NOTIFICATION_TRANSPORT, NOTIFIER assert TRANSPORT is not None + assert NOTIFICATION_TRANSPORT is not None assert NOTIFIER is not None TRANSPORT.cleanup() - TRANSPORT = NOTIFIER = None + NOTIFICATION_TRANSPORT.cleanup() + TRANSPORT = NOTIFIER = NOTIFICATION_TRANSPORT = None def set_defaults(control_exchange):