From a31b963c1bc6f52cbfd71e29dfa54509b5deadcc Mon Sep 17 00:00:00 2001 From: Juan Antonio Osorio Robles Date: Fri, 1 Apr 2016 08:51:54 +0300 Subject: [PATCH] Use messaging notifications transport instead of default The usage of oslo_messaging.get_transport is not meant for notifications; And oslo_messaging.get_notification_transport is favored for those means. So this change introduces the usage of that function. If the settings for the notifications are not set with the configuration that's under the oslo_messaging_notifications group, this will fall back to the old settings which are under the DEFAULT group; just like this used to work. Closes-Bug: #1567231 Change-Id: I137d0f98533d8121334e8538d321fb6c7495f35f --- glance/notifier.py | 2 +- glance/tests/unit/test_notifier.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/glance/notifier.py b/glance/notifier.py index 5727378bf3..dac2adbd53 100644 --- a/glance/notifier.py +++ b/glance/notifier.py @@ -62,7 +62,7 @@ def set_defaults(control_exchange='glance'): def get_transport(): - return oslo_messaging.get_transport(CONF, aliases=_ALIASES) + return oslo_messaging.get_notification_transport(CONF, aliases=_ALIASES) class Notifier(object): diff --git a/glance/tests/unit/test_notifier.py b/glance/tests/unit/test_notifier.py index 71cebae918..ec994abf09 100644 --- a/glance/tests/unit/test_notifier.py +++ b/glance/tests/unit/test_notifier.py @@ -116,7 +116,7 @@ class TaskRepoStub(object): class TestNotifier(utils.BaseTestCase): @mock.patch.object(oslo_messaging, 'Notifier') - @mock.patch.object(oslo_messaging, 'get_transport') + @mock.patch.object(oslo_messaging, 'get_notification_transport') def _test_load_strategy(self, mock_get_transport, mock_notifier, url, driver):