summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Giusti <kgiusti@gmail.com>2017-08-07 09:41:36 -0400
committerAndrew Smith <ansmith@redhat.com>2017-12-29 12:15:01 -0500
commit0c4ae8012e9ed9203f4a1685477d02ce31f0defb (patch)
tree648a1d634fcb13a728bb57abe1e6d8936c98722d
parent05a09eb2cce0019c74394bf6e3141897cc348c01 (diff)
Add support for virtual_host parameter
Notes
Notes (review): Code-Review+2: Andy Smith <ansmith@redhat.com> Workflow+1: Ken Giusti <kgiusti@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 09 Jan 2018 21:47:02 +0000 Reviewed-on: https://review.openstack.org/491497 Project: openstack/devstack-plugin-kafka Branch: refs/heads/master
-rw-r--r--devstack/plugin.sh21
-rw-r--r--devstack/settings4
2 files changed, 17 insertions, 8 deletions
diff --git a/devstack/plugin.sh b/devstack/plugin.sh
index 89074b6..32f88f0 100644
--- a/devstack/plugin.sh
+++ b/devstack/plugin.sh
@@ -40,19 +40,21 @@ set +o xtrace
40 40
41# builds rpc transport url string 41# builds rpc transport url string
42function _get_rpc_transport_url { 42function _get_rpc_transport_url {
43 local virtual_host=$1
43 if [ -z "$RPC_USERNAME" ]; then 44 if [ -z "$RPC_USERNAME" ]; then
44 echo "amqp://$RPC_HOST:${RPC_PORT}/" 45 echo "amqp://$RPC_HOST:${RPC_PORT}/$virtual_host"
45 else 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 fi 48 fi
48} 49}
49 50
50# builds notify transport url string 51# builds notify transport url string
51function _get_notify_transport_url { 52function _get_notify_transport_url {
53 local virtual_host=$1
52 if [ -z "$NOTIFY_USERNAME" ]; then 54 if [ -z "$NOTIFY_USERNAME" ]; then
53 echo "kafka://$NOTIFY_HOST:${NOTIFY_PORT}/" 55 echo "kafka://$NOTIFY_HOST:${NOTIFY_PORT}/$virtual_host"
54 else 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 fi 58 fi
57} 59}
58 60
@@ -366,8 +368,10 @@ if is_service_enabled kafka; then
366 local package=$1 368 local package=$1
367 local file=$2 369 local file=$2
368 local section=${3:-DEFAULT} 370 local section=${3:-DEFAULT}
369 iniset $file $section transport_url $(_get_rpc_transport_url) 371 local virtual_host=$4
370 iniset $file oslo_messaging_notifications transport_url $(_get_notify_transport_url) 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 function get_transport_url { 376 function get_transport_url {
373 # TODO (ansmith) introduce separate get_*_transport calls in devstak 377 # TODO (ansmith) introduce separate get_*_transport calls in devstak
@@ -376,9 +380,14 @@ if is_service_enabled kafka; then
376 function get_notification_url { 380 function get_notification_url {
377 _get_notify_transport_url $@ 381 _get_notify_transport_url $@
378 } 382 }
383 function rpc_backend_add_vhost {
384 return 0
385 }
386
379 export -f iniset_rpc_backend 387 export -f iniset_rpc_backend
380 export -f get_transport_url 388 export -f get_transport_url
381 export -f get_notification_url 389 export -f get_notification_url
390 export -f rpc_backend_add_vhost
382fi 391fi
383 392
384# check for kafka service 393# check for kafka service
diff --git a/devstack/settings b/devstack/settings
index fc297fd..325f006 100644
--- a/devstack/settings
+++ b/devstack/settings
@@ -6,8 +6,8 @@ enable_service kafka
6KAFKA_DEST=${KAFKA_DEST:-/opt/stack/devstack-plugin-kafka} 6KAFKA_DEST=${KAFKA_DEST:-/opt/stack/devstack-plugin-kafka}
7 7
8# Specify Kafka version 8# Specify Kafka version
9KAFKA_VERSION=${KAFKA_VERSION:-0.10.2.1} 9KAFKA_VERSION=${KAFKA_VERSION:-1.0.0}
10KAFKA_BASEURL=${KAFKA_BASEURL:-http://www.us.apache.org/dist/kafka} 10KAFKA_BASEURL=${KAFKA_BASEURL:-http://www.apache.org/dist/kafka}
11 11
12# Specify Scala version 12# Specify Scala version
13SCALA_VERSION=${SCALA_VERSION:-2.12} 13SCALA_VERSION=${SCALA_VERSION:-2.12}