Skip to content

Commit b645904

Browse files
committed
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
1 parent dea3083 commit b645904

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

lib/nova

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ function create_nova_conf {
536536
# Set the oslo messaging driver to the typical default. This does not
537537
# enable notifications, but it will allow them to function when enabled.
538538
iniset $NOVA_CONF oslo_messaging_notifications driver "messagingv2"
539-
iniset $NOVA_CONF oslo_messaging_notifications transport_url $(get_transport_url)
539+
iniset $NOVA_CONF oslo_messaging_notifications transport_url $(get_notification_url)
540540
iniset_rpc_backend nova $NOVA_CONF
541541
iniset $NOVA_CONF glance api_servers "$GLANCE_URL"
542542

lib/rpc_backend

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,17 @@ function rpc_backend_add_vhost {
114114
fi
115115
}
116116

117-
# builds transport url string
117+
# Returns the address of the RPC backend in URL format.
118118
function get_transport_url {
119119
local virtual_host=$1
120120
if is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then
121121
echo "rabbit://$RABBIT_USERID:$RABBIT_PASSWORD@$RABBIT_HOST:5672/$virtual_host"
122122
fi
123123
}
124124

125-
# Repeat the definition, in case get_transport_url is overriden for RPC purpose.
126-
# get_notification_url can then be used to talk to rabbit for notifications.
125+
# Returns the address of the Notification backend in URL format. This
126+
# should be used to set the transport_url option in the
127+
# oslo_messaging_notifications group.
127128
function get_notification_url {
128129
local virtual_host=$1
129130
if is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then

0 commit comments

Comments
 (0)