From 5b8d42064af9ee791b72bcda840decffd9e18c66 Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Tue, 29 Aug 2017 09:57:48 -0400 Subject: Apex, Yardstick: Fixes fetching creds 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 --- utils/fetch_os_creds.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/fetch_os_creds.sh b/utils/fetch_os_creds.sh index 312e1ac5c..8fbbdce65 100755 --- a/utils/fetch_os_creds.sh +++ b/utils/fetch_os_creds.sh @@ -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) -- cgit 1.2.3-korg