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
This commit is contained in:
Darren Hague 2017-03-10 10:38:41 +00:00
parent f11ec8d876
commit 379f10fc73
2 changed files with 6 additions and 1 deletions

@ -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:

@ -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.