X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=utils%2Ffetch_os_creds.sh;h=8fbbdce655b86794860f8e0f884b341036946491;hb=refs%2Fchanges%2F91%2F40591%2F1;hp=8374edbbdb23ddb5efd126f86dbcfe488dc035b2;hpb=8a65233f2d7d326f7ac7d2c9f6c7d6f7185c260b;p=releng.git diff --git a/utils/fetch_os_creds.sh b/utils/fetch_os_creds.sh index 8374edbbd..8fbbdce65 100755 --- a/utils/fetch_os_creds.sh +++ b/utils/fetch_os_creds.sh @@ -107,7 +107,7 @@ if [ "$installer_type" == "fuel" ]; then # retrieving controller vip controller_ip=$(ssh 2>/dev/null ${ssh_options} ubuntu@${installer_ip} \ - "sudo salt --out txt 'ctl01*' pillar.get _param:openstack_control_address | awk '{print \$2}'" | \ + "sudo salt --out txt 'ctl*' pillar.get _param:openstack_control_address | awk '{print \$2; exit}'" | \ sed 's/ //g') &> /dev/null info "Fetching rc file from controller $controller_ip..." @@ -144,6 +144,13 @@ if [ "$installer_type" == "fuel" ]; then echo $auth_url >> $dest_path elif [ "$installer_type" == "apex" ]; then + if ! ipcalc -c $installer_ip; then + installer_ip=$(virsh domifaddr undercloud | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') + if [ -z "$installer_ip" ] || ! $(ipcalc -c $installer_ip); then + echo "Unable to find valid IP for Apex undercloud: ${installer_ip}" + exit 1 + fi + fi verify_connectivity $installer_ip # The credentials file is located in the Instack VM (192.0.2.1)