diff --git a/ceilometer/notification.py b/ceilometer/notification.py index 1c87843b..c33e536b 100644 --- a/ceilometer/notification.py +++ b/ceilometer/notification.py @@ -116,7 +116,7 @@ class NotificationService(service_base.PipelineBasedService): transport, driver=cfg.CONF.publisher_notifier.telemetry_driver, publisher_id=pipe.name, - topic='%s-%s-%s' % (self.NOTIFICATION_IPC, pipe.name, x))) + topics=['%s-%s-%s' % (self.NOTIFICATION_IPC, pipe.name, x)])) return notifiers def _get_pipe_manager(self, transport, pipeline_manager): diff --git a/ceilometer/publisher/messaging.py b/ceilometer/publisher/messaging.py index e8a88ef5..3a12690f 100644 --- a/ceilometer/publisher/messaging.py +++ b/ceilometer/publisher/messaging.py @@ -192,12 +192,12 @@ class NotifierPublisher(MessagingPublisher): def __init__(self, parsed_url, default_topic): super(NotifierPublisher, self).__init__(parsed_url) options = urlparse.parse_qs(parsed_url.query) - topic = options.get('topic', [default_topic])[-1] + topic = options.get('topic', [default_topic]) self.notifier = oslo_messaging.Notifier( messaging.get_transport(), driver=cfg.CONF.publisher_notifier.telemetry_driver, publisher_id='telemetry.publisher.%s' % cfg.CONF.host, - topic=topic, + topics=topic, retry=self.retry ) diff --git a/ceilometer/tests/unit/publisher/test_messaging_publisher.py b/ceilometer/tests/unit/publisher/test_messaging_publisher.py index 508d80f6..203424e2 100644 --- a/ceilometer/tests/unit/publisher/test_messaging_publisher.py +++ b/ceilometer/tests/unit/publisher/test_messaging_publisher.py @@ -107,13 +107,13 @@ class NotifierOnlyPublisherTest(BasePublisherTestCase): def test_publish_topic_override(self, notifier): msg_publisher.SampleNotifierPublisher( netutils.urlsplit('notifier://?topic=custom_topic')) - notifier.assert_called_with(mock.ANY, topic='custom_topic', + notifier.assert_called_with(mock.ANY, topics=['custom_topic'], driver=mock.ANY, retry=mock.ANY, publisher_id=mock.ANY) msg_publisher.EventNotifierPublisher( netutils.urlsplit('notifier://?topic=custom_event_topic')) - notifier.assert_called_with(mock.ANY, topic='custom_event_topic', + notifier.assert_called_with(mock.ANY, topics=['custom_event_topic'], driver=mock.ANY, retry=mock.ANY, publisher_id=mock.ANY) diff --git a/tools/send_test_data.py b/tools/send_test_data.py index a1d37a3a..867c34a4 100755 --- a/tools/send_test_data.py +++ b/tools/send_test_data.py @@ -48,7 +48,7 @@ def get_notifier(config_file): messaging.get_transport(), driver='messagingv2', publisher_id='telemetry.publisher.test', - topic='metering', + topics=['metering'], )