Browse Source

Add support for virtual_host parameter

Depends-On: Idd164444c04e9f465a43ee909af840a41bb090c0
Change-Id: I4fe6c0139ea1d05c2978b2c223c38ae30d28d2a9
Partial-Bug: #1709081
Kenneth Giusti 1 year ago
parent
commit
0c4ae8012e
2 changed files with 17 additions and 8 deletions
  1. 15
    6
      devstack/plugin.sh
  2. 2
    2
      devstack/settings

+ 15
- 6
devstack/plugin.sh View File

@@ -40,19 +40,21 @@ set +o xtrace
40 40
 
41 41
 # builds rpc transport url string
42 42
 function _get_rpc_transport_url {
43
+    local virtual_host=$1
43 44
     if [ -z "$RPC_USERNAME" ]; then
44
-        echo "amqp://$RPC_HOST:${RPC_PORT}/"
45
+        echo "amqp://$RPC_HOST:${RPC_PORT}/$virtual_host"
45 46
     else
46
-        echo "amqp://$RPC_USERNAME:$RPC_PASSWORD@$RPC_HOST:${RPC_PORT}/"
47
+        echo "amqp://$RPC_USERNAME:$RPC_PASSWORD@$RPC_HOST:${RPC_PORT}/$virtual_host"
47 48
     fi
48 49
 }
49 50
 
50 51
 # builds notify transport url string
51 52
 function _get_notify_transport_url {
53
+    local virtual_host=$1
52 54
     if [ -z "$NOTIFY_USERNAME" ]; then
53
-        echo "kafka://$NOTIFY_HOST:${NOTIFY_PORT}/"
55
+        echo "kafka://$NOTIFY_HOST:${NOTIFY_PORT}/$virtual_host"
54 56
     else
55
-        echo "kafka://$NOTIFY_USERNAME:$NOTIFY_PASSWORD@$NOTIFY_HOST:${NOTIFY_PORT}/"
57
+        echo "kafka://$NOTIFY_USERNAME:$NOTIFY_PASSWORD@$NOTIFY_HOST:${NOTIFY_PORT}/$virtual_host"
56 58
     fi
57 59
 }
58 60
 
@@ -366,8 +368,10 @@ if is_service_enabled kafka; then
366 368
         local package=$1
367 369
         local file=$2
368 370
         local section=${3:-DEFAULT}
369
-        iniset $file $section transport_url $(_get_rpc_transport_url)
370
-        iniset $file oslo_messaging_notifications transport_url $(_get_notify_transport_url)
371
+        local virtual_host=$4
372
+
373
+        iniset $file $section transport_url $(_get_rpc_transport_url "$virtual_host")
374
+        iniset $file oslo_messaging_notifications transport_url $(_get_notify_transport_url "$virtual_host")
371 375
     }
372 376
     function get_transport_url {
373 377
         # TODO (ansmith) introduce separate get_*_transport calls in devstak
@@ -376,9 +380,14 @@ if is_service_enabled kafka; then
376 380
     function get_notification_url {
377 381
         _get_notify_transport_url $@
378 382
     }
383
+    function rpc_backend_add_vhost {
384
+        return 0
385
+    }
386
+
379 387
     export -f iniset_rpc_backend
380 388
     export -f get_transport_url
381 389
     export -f get_notification_url
390
+    export -f rpc_backend_add_vhost
382 391
 fi
383 392
 
384 393
 # check for kafka service

+ 2
- 2
devstack/settings View File

@@ -6,8 +6,8 @@ enable_service kafka
6 6
 KAFKA_DEST=${KAFKA_DEST:-/opt/stack/devstack-plugin-kafka}
7 7
 
8 8
 # Specify Kafka version
9
-KAFKA_VERSION=${KAFKA_VERSION:-0.10.2.1}
10
-KAFKA_BASEURL=${KAFKA_BASEURL:-http://www.us.apache.org/dist/kafka}
9
+KAFKA_VERSION=${KAFKA_VERSION:-1.0.0}
10
+KAFKA_BASEURL=${KAFKA_BASEURL:-http://www.apache.org/dist/kafka}
11 11
 
12 12
 # Specify Scala version
13 13
 SCALA_VERSION=${SCALA_VERSION:-2.12}

Loading…
Cancel
Save