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:
@@ -14,6 +14,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import oslo_messaging
|
import oslo_messaging
|
||||||
|
from oslo_messaging.notify import notifier
|
||||||
from oslo_messaging import serializer as oslo_serializer
|
from oslo_messaging import serializer as oslo_serializer
|
||||||
|
|
||||||
DEFAULT_URL = "__default__"
|
DEFAULT_URL = "__default__"
|
||||||
@@ -31,7 +32,7 @@ def get_transport(conf, url=None, optional=False, cache=True):
|
|||||||
transport = TRANSPORTS.get(cache_key)
|
transport = TRANSPORTS.get(cache_key)
|
||||||
if not transport or not cache:
|
if not transport or not cache:
|
||||||
try:
|
try:
|
||||||
transport = oslo_messaging.get_transport(conf, url)
|
transport = notifier.get_notification_transport(conf, url)
|
||||||
except (oslo_messaging.InvalidTransportURL,
|
except (oslo_messaging.InvalidTransportURL,
|
||||||
oslo_messaging.DriverLoadFailure):
|
oslo_messaging.DriverLoadFailure):
|
||||||
if not optional or url:
|
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.
|
Reference in New Issue
Block a user