From 6176ae6895c3c62e9406ebca0055fed9a58f35d1 Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Wed, 18 May 2016 12:10:08 +0200 Subject: [PATCH] Use transport_url instead of driver-specif options Future oslo.messaging is going to deprecate usage of driver-specific options for hosts/port/user/password options. This change uses transport_url that exists since a while now and works with all drivers (even devstack handles only the rabbit one). Change-Id: I3006b96ff93a3468249177c31c359c2f9ddc5db6 --- lib/nova | 2 +- lib/rpc_backend | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/nova b/lib/nova index de898b23fd..e928cf264c 100644 --- a/lib/nova +++ b/lib/nova @@ -639,7 +639,7 @@ function init_nova_cells { if is_service_enabled n-cell; then cp $NOVA_CONF $NOVA_CELLS_CONF iniset $NOVA_CELLS_CONF database connection `database_connection_url $NOVA_CELLS_DB` - iniset $NOVA_CELLS_CONF oslo_messaging_rabbit rabbit_virtual_host child_cell + iniset_rpc_backend nova $NOVA_CELLS_CONF DEFAULT child_cell iniset $NOVA_CELLS_CONF DEFAULT dhcpbridge_flagfile $NOVA_CELLS_CONF iniset $NOVA_CELLS_CONF cells enable True iniset $NOVA_CELLS_CONF cells cell_type compute diff --git a/lib/rpc_backend b/lib/rpc_backend index 05e303e3e7..0ee46dca6f 100644 --- a/lib/rpc_backend +++ b/lib/rpc_backend @@ -104,8 +104,9 @@ function restart_rpc_backend { # builds transport url string function get_transport_url { + local virtual_host=$1 if is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then - echo "rabbit://$RABBIT_USERID:$RABBIT_PASSWORD@$RABBIT_HOST:5672/" + echo "rabbit://$RABBIT_USERID:$RABBIT_PASSWORD@$RABBIT_HOST:5672/$virtual_host" fi } @@ -114,11 +115,9 @@ function iniset_rpc_backend { local package=$1 local file=$2 local section=${3:-DEFAULT} + local virtual_host=$4 if is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then - iniset $file $section rpc_backend "rabbit" - iniset $file oslo_messaging_rabbit rabbit_hosts $RABBIT_HOST - iniset $file oslo_messaging_rabbit rabbit_password $RABBIT_PASSWORD - iniset $file oslo_messaging_rabbit rabbit_userid $RABBIT_USERID + iniset $file $section transport_url $(get_transport_url "$virtual_host") if [ -n "$RABBIT_HEARTBEAT_TIMEOUT_THRESHOLD" ]; then iniset $file oslo_messaging_rabbit heartbeat_timeout_threshold $RABBIT_HEARTBEAT_TIMEOUT_THRESHOLD fi