From b645904d4aae46a8be5cee3a23710565b211f458 Mon Sep 17 00:00:00 2001 From: Kenneth Giusti Date: Fri, 4 Aug 2017 18:08:37 -0400 Subject: [PATCH] Use get_notification_url when configuring notifications If a project manually configures the oslo.messaging transport url for notifications it should use 'get_notification_url', not 'get_transport_url'. get_transport_url should only be used to obtain the RPC transport address. Change-Id: I77772dfa9f30a3db2db6d0387260dfe3452a26ef Closes-Bug: #1708754 --- lib/nova | 2 +- lib/rpc_backend | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/nova b/lib/nova index 8311a54930..c988c2f06b 100644 --- a/lib/nova +++ b/lib/nova @@ -536,7 +536,7 @@ function create_nova_conf { # Set the oslo messaging driver to the typical default. This does not # enable notifications, but it will allow them to function when enabled. iniset $NOVA_CONF oslo_messaging_notifications driver "messagingv2" - iniset $NOVA_CONF oslo_messaging_notifications transport_url $(get_transport_url) + iniset $NOVA_CONF oslo_messaging_notifications transport_url $(get_notification_url) iniset_rpc_backend nova $NOVA_CONF iniset $NOVA_CONF glance api_servers "$GLANCE_URL" diff --git a/lib/rpc_backend b/lib/rpc_backend index 3177e88ef2..fb1cf73b99 100644 --- a/lib/rpc_backend +++ b/lib/rpc_backend @@ -114,7 +114,7 @@ function rpc_backend_add_vhost { fi } -# builds transport url string +# Returns the address of the RPC backend in URL format. function get_transport_url { local virtual_host=$1 if is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then @@ -122,8 +122,9 @@ function get_transport_url { fi } -# Repeat the definition, in case get_transport_url is overriden for RPC purpose. -# get_notification_url can then be used to talk to rabbit for notifications. +# Returns the address of the Notification backend in URL format. This +# should be used to set the transport_url option in the +# oslo_messaging_notifications group. function get_notification_url { local virtual_host=$1 if is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then