bug 11663: iterate the whole /var/cache/cloud/cmdline to find out the mgt server ip address, as the position is different for each hypervisor

status 11663: resolved fixed
This commit is contained in:
Edison Su 2011-10-06 14:21:14 -07:00
parent a51fb221d6
commit f6acda0b91
1 changed files with 10 additions and 1 deletions

View File

@ -26,6 +26,16 @@
CMDLINE=/var/cache/cloud/cmdline
for i in `cat $CMDLINE`
do
key=`echo $i | cut -d= -f1`
value=`echo $i | cut -d= -f2`
case $key in
host)
MGMTSERVER=$value
;;
esac
done
# ping dns server
@ -100,7 +110,6 @@ fi
# check for connectivity to the management server
echo ================================================
MGMTSERVER=`awk '{print $12}' $CMDLINE | awk -F= '{print $2}'`
echo Management server is $MGMTSERVER. Checking connectivity.
socatout=$(echo | socat - TCP:$MGMTSERVER:8250,connect-timeout=3 2>&1)
if [ $? -eq 0 ]