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
This commit is contained in:
Kenneth Giusti 2017-08-04 18:08:37 -04:00
parent dea3083d98
commit b645904d4a
2 changed files with 5 additions and 4 deletions

View File

@ -536,7 +536,7 @@ function create_nova_conf {
# Set the oslo messaging driver to the typical default. This does not # Set the oslo messaging driver to the typical default. This does not
# enable notifications, but it will allow them to function when enabled. # 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 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_rpc_backend nova $NOVA_CONF
iniset $NOVA_CONF glance api_servers "$GLANCE_URL" iniset $NOVA_CONF glance api_servers "$GLANCE_URL"

View File

@ -114,7 +114,7 @@ function rpc_backend_add_vhost {
fi fi
} }
# builds transport url string # Returns the address of the RPC backend in URL format.
function get_transport_url { function get_transport_url {
local virtual_host=$1 local virtual_host=$1
if is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then if is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then
@ -122,8 +122,9 @@ function get_transport_url {
fi fi
} }
# Repeat the definition, in case get_transport_url is overriden for RPC purpose. # Returns the address of the Notification backend in URL format. This
# get_notification_url can then be used to talk to rabbit for notifications. # should be used to set the transport_url option in the
# oslo_messaging_notifications group.
function get_notification_url { function get_notification_url {
local virtual_host=$1 local virtual_host=$1
if is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then if is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then