From 379f10fc739358b85b031761fad7d9cd2658af77 Mon Sep 17 00:00:00 2001 From: Darren Hague Date: Fri, 10 Mar 2017 10:38:41 +0000 Subject: [PATCH] Bugfix: use transport_url from [oslo_messaging_notifications] if present According to https://docs.openstack.org/developer/oslo.messaging/opts.html#oslo-messaging-notifications a transport_url defined in [oslo_messaging_notifications] should be used, if present. In Ceilometer, this is ignored in favour of the transport_url defined in [DEFAULT], which is a bug. This change fixes the bug. Change-Id: I12a559ebbbc1edd18c6833943bb5e9af7adf4666 --- ceilometer/messaging.py | 3 ++- .../use-notification-transport-url-489f3d31dc66c4d2.yaml | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/use-notification-transport-url-489f3d31dc66c4d2.yaml diff --git a/ceilometer/messaging.py b/ceilometer/messaging.py index 8f8211bede..8c14731426 100644 --- a/ceilometer/messaging.py +++ b/ceilometer/messaging.py @@ -14,6 +14,7 @@ # under the License. import oslo_messaging +from oslo_messaging.notify import notifier from oslo_messaging import serializer as oslo_serializer DEFAULT_URL = "__default__" @@ -31,7 +32,7 @@ def get_transport(conf, url=None, optional=False, cache=True): transport = TRANSPORTS.get(cache_key) if not transport or not cache: try: - transport = oslo_messaging.get_transport(conf, url) + transport = notifier.get_notification_transport(conf, url) except (oslo_messaging.InvalidTransportURL, oslo_messaging.DriverLoadFailure): if not optional or url: diff --git a/releasenotes/notes/use-notification-transport-url-489f3d31dc66c4d2.yaml b/releasenotes/notes/use-notification-transport-url-489f3d31dc66c4d2.yaml new file mode 100644 index 0000000000..81c15aedbd --- /dev/null +++ b/releasenotes/notes/use-notification-transport-url-489f3d31dc66c4d2.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - The transport_url defined in [oslo_messaging_notifications] was never used, + which contradicts the oslo_messaging documentation. This is now fixed. \ No newline at end of file