[bugfix] wrong regular expression to fetch controller ip by hostname 19/28319/1
authormeimei <meimei@huawei.com>
Wed, 8 Feb 2017 09:31:47 +0000 (17:31 +0800)
committermeimei <meimei@huawei.com>
Thu, 9 Feb 2017 01:09:52 +0000 (09:09 +0800)
Change-Id: Idcf6739498837e828dd65897f599dada720fb48e
Signed-off-by: meimei <meimei@huawei.com>
utils/fetch_os_creds.sh

index c1e21f3..f00e022 100755 (executable)
@@ -144,7 +144,7 @@ elif [ "$installer_type" == "compass" ]; then
     verify_connectivity $installer_ip
     controller_ip=$(sshpass -p'root' ssh 2>/dev/null $ssh_options root@${installer_ip} \
         'mysql -ucompass -pcompass -Dcompass -e"select *  from cluster;"' \
-        | awk -F"," '{for(i=1;i<NF;i++)if($i~/\"host[1-5]\"/) {print $(i+1);break;}}'  \
+        | awk -F"," '{for(i=1;i<NF;i++)if($i~/\"127.0.0.1\"/) {print $(i+2);break;}}'  \
         | grep -oP "\d+.\d+.\d+.\d+")
 
     if [ -z $controller_ip ]; then