summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorJun Li <matthew.lijun@huawei.com>2017-01-03 01:46:06 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-01-03 01:46:06 +0000
commit26373f7bfbd0b1dc5ae4dbcff06800a2f7f12760 (patch)
tree139069dc952933063c45b8e01ece17508e2e8ce0 /utils
parenta78dda01dc569027fdace4008a6c40725613337a (diff)
parentec95c66f771cc93801a3f73db30f42c184054cac (diff)
Merge "Fix compass public vip fetch bug in Newton"
Diffstat (limited to 'utils')
-rwxr-xr-xutils/fetch_os_creds.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/utils/fetch_os_creds.sh b/utils/fetch_os_creds.sh
index 47fbc91dc..ecc571dba 100755
--- a/utils/fetch_os_creds.sh
+++ b/utils/fetch_os_creds.sh
@@ -144,9 +144,17 @@ elif [ "$installer_type" == "compass" ]; then
sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:~/admin-openrc.sh $dest_path &> /dev/null
info "This file contains the mgmt keystone API, we need the public one for our rc file"
- public_ip=$(sshpass -p root ssh $ssh_options root@${installer_ip} \
- "ssh ${controller_ip} 'source /opt/admin-openrc.sh; openstack endpoint show identity '" \
- | grep publicurl | awk '{print $4}')
+ grep "OS_AUTH_URL.*v2" $dest_path > /dev/null 2>&1
+ if [ $? -eq 0 ] ; then
+ public_ip=$(sshpass -p root ssh $ssh_options root@${installer_ip} \
+ "ssh ${controller_ip} 'source /opt/admin-openrc.sh; openstack endpoint show identity '" \
+ | grep publicurl | awk '{print $4}')
+ else
+ public_ip=$(sshpass -p root ssh $ssh_options root@${installer_ip} \
+ "ssh ${controller_ip} 'source /opt/admin-openrc.sh; \
+ openstack endpoint list --interface public --service identity '" \
+ | grep identity | awk '{print $14}')
+ fi
info "public_ip: $public_ip"