Apex, Yardstick: Fixes fetching creds 91/40591/1
authorTim Rozet <trozet@redhat.com>
Tue, 29 Aug 2017 13:57:48 +0000 (09:57 -0400)
committerTim Rozet <trozet@redhat.com>
Tue, 29 Aug 2017 13:57:48 +0000 (09:57 -0400)
There is a bug where by default the INSTALLER_IP is set to 192.168.X.X
and in yardstick the IP is never found for Apex before trying to fetch,
so fetching fails to an invalid IP address.

This patch makes fetch os creds more robust to check if the INSTALLER_IP
is valid and if not, then attempt to find the correct IP for Apex.

Change-Id: Ie18d6e70f77ccff3592fb37c6d0b6e87b6435cf8
Signed-off-by: Tim Rozet <trozet@redhat.com>
utils/fetch_os_creds.sh

index 312e1ac..8fbbdce 100755 (executable)
@@ -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)