Merge "Fix listener setup in health manager"

This commit is contained in:
Jenkins 2016-07-26 09:07:52 +00:00 committed by Gerrit Code Review
commit f5a39ccd49
2 changed files with 4 additions and 5 deletions

View File

@ -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()

View File

@ -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()