From 1145b5abf18ca6b514001a0fc6f2d13fce158c8c Mon Sep 17 00:00:00 2001 From: tengqm Date: Fri, 22 Jul 2016 04:50:28 -0400 Subject: [PATCH] Fix listener setup in health manager We should have used get_notification_transport when setting up the listener infrastructure instead of calling get_transport which was meant for RPC only. This patch also changes the pool name used to 'senlin-listeners' to differentiate it from other possible pools. Change-Id: I44966081cee0c9a0810732a9087094ed8433e8da --- senlin/engine/health_manager.py | 5 ++--- senlin/tests/unit/engine/test_health_manager.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/senlin/engine/health_manager.py b/senlin/engine/health_manager.py index ccc4144e8..160d05957 100644 --- a/senlin/engine/health_manager.py +++ b/senlin/engine/health_manager.py @@ -63,16 +63,15 @@ class NotificationEndpoint(object): def ListenerProc(exchange, project_id, cluster_id): - transport = messaging.get_transport(cfg.CONF) + transport = messaging.get_notification_transport(cfg.CONF) targets = [ messaging.Target(topic='notifications', exchange=exchange), ] endpoints = [ NotificationEndpoint(project_id, cluster_id), ] - pool = "listener-workers" listener = messaging.get_notification_listener( - transport, targets, endpoints, pool=pool) + transport, targets, endpoints, pool="senlin-listeners") listener.start() listener.wait() diff --git a/senlin/tests/unit/engine/test_health_manager.py b/senlin/tests/unit/engine/test_health_manager.py index c6a7228e4..bbc4da118 100644 --- a/senlin/tests/unit/engine/test_health_manager.py +++ b/senlin/tests/unit/engine/test_health_manager.py @@ -40,7 +40,7 @@ class TestNotificationEndpoint(base.SenlinTestCase): @mock.patch('senlin.engine.health_manager.NotificationEndpoint') @mock.patch('oslo_messaging.Target') -@mock.patch('oslo_messaging.get_transport') +@mock.patch('oslo_messaging.get_notification_transport') @mock.patch('oslo_messaging.get_notification_listener') class TestListenerProc(base.SenlinTestCase): @@ -64,7 +64,7 @@ class TestListenerProc(base.SenlinTestCase): exchange='EXCHANGE') mock_endpoint.assert_called_once_with('PROJECT_ID', 'CLUSTER_ID') mock_listener.assert_called_once_with( - x_transport, [x_target], [x_endpoint], pool="listener-workers") + x_transport, [x_target], [x_endpoint], pool="senlin-listeners") x_listener.start.assert_called_once_with() x_listener.wait.assert_called_once_with()