summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Giusti <kgiusti@gmail.com>2017-08-07 09:33:45 -0400
committerKenneth Giusti <kgiusti@gmail.com>2017-08-07 09:33:45 -0400
commit2f6ed91ace09489e0ab05c9a6785a8c92df41091 (patch)
tree2abb101ba6b23c466f251ff46c43411c907d2300
parenta3a28940890a5dcc0f0eb36ce2f8515a4154bbfd (diff)
Add support for virtual_host parameter
Notes
Notes (review): Code-Review+2: ChangBo Guo(gcb) <glongwave@gmail.com> Workflow+1: Ken Giusti <kgiusti@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 24 Aug 2017 17:40:50 +0000 Reviewed-on: https://review.openstack.org/491495 Project: openstack/devstack-plugin-pika Branch: refs/heads/master
-rw-r--r--devstack/plugin.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/devstack/plugin.sh b/devstack/plugin.sh
index 4d1fd59..7fafd06 100644
--- a/devstack/plugin.sh
+++ b/devstack/plugin.sh
@@ -15,13 +15,24 @@
15# under the License. 15# under the License.
16 16
17function get_transport_url { 17function get_transport_url {
18 echo "pika://$RABBIT_USERID:$RABBIT_PASSWORD@$RABBIT_HOST:5672" 18 local virtual_host=$1
19 echo "pika://$RABBIT_USERID:$RABBIT_PASSWORD@$RABBIT_HOST:5672/$virtual_host"
19} 20}
20 21
22function get_notification_url {
23 local virtual_host=$1
24 echo "pika://$RABBIT_USERID:$RABBIT_PASSWORD@$RABBIT_HOST:5672/$virtual_host"
25}
26
27# Note: no need to override default 'rpc_backend_add_vhost' since the
28# backend is also rabbitmq
29
21function iniset_rpc_backend { 30function iniset_rpc_backend {
22 local package=$1 31 local package=$1
23 local file=$2 32 local file=$2
24 local section=${3:-DEFAULT} 33 local section=${3:-DEFAULT}
34 local virtual_host=$4
25 35
26 iniset $file $section transport_url $(get_transport_url) 36 iniset $file $section transport_url $(get_transport_url "$virtual_host")
37 iniset $file oslo_messaging_notifications transport_url $(get_notification_url "$virtual_host")
27} 38}