From 7663c9562b905d0bdea560c953ca1baabb48fbc7 Mon Sep 17 00:00:00 2001 From: gordon chung Date: Tue, 2 Feb 2016 08:30:20 -0500 Subject: [PATCH] devstack: support publicURL retrieval in both keystone v2/v3 format Recent devstack commit Ia792b23119c00089542ba08879dca1c29dc80945 revert keystone to use V2 api again, we need to support both v2/v3 output format. Change-Id: Ib51769336331872dc33a18097718d1cb54643d5e Co-Authored-By: Lianhao Lu --- aodh/tests/functional/hooks/post_test_hook.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aodh/tests/functional/hooks/post_test_hook.sh b/aodh/tests/functional/hooks/post_test_hook.sh index 916ccd4b..992d34ad 100755 --- a/aodh/tests/functional/hooks/post_test_hook.sh +++ b/aodh/tests/functional/hooks/post_test_hook.sh @@ -36,8 +36,13 @@ if [ -d $BASE/new/devstack ]; then STACK_USER=stack sudo chown -R $STACK_USER:stack $AODH_DIR source $BASE/new/devstack/openrc admin admin + if [ $OS_IDENTITY_API_VERSION == '2.0' ]; then + urltag='publicURL' + else + urltag='public' + fi openstack catalog list - export AODH_SERVICE_URL=$(openstack catalog show alarming -c endpoints -f value | awk '/public/{print $2}') + export AODH_SERVICE_URL=$(openstack catalog show alarming -c endpoints -f value | awk "/$urltag"'/{print $2}') export AODH_SERVICE_TOKEN=$(openstack token issue -c id -f value) # Go to the aodh dir cd $AODH_DIR