Browse Source

Add support for virtual_host parameter

Change-Id: I08e1489e225bb13b6d8bb08807216ee1ab84d693
Partial-Bug: #1709081
changes/95/491495/1
Kenneth Giusti 1 year ago
parent
commit
2f6ed91ace
1 changed files with 13 additions and 2 deletions
  1. 13
    2
      devstack/plugin.sh

+ 13
- 2
devstack/plugin.sh View File

@@ -15,13 +15,24 @@
15 15
 # under the License.
16 16
 
17 17
 function 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
 
22
+function 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
+
21 30
 function iniset_rpc_backend {
22 31
     local package=$1
23 32
     local file=$2
24 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
 }

Loading…
Cancel
Save