aboutsummaryrefslogtreecommitdiffstats
path: root/func/fetch_compute_ips.sh
diff options
context:
space:
mode:
Diffstat (limited to 'func/fetch_compute_ips.sh')
-rwxr-xr-xfunc/fetch_compute_ips.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/func/fetch_compute_ips.sh b/func/fetch_compute_ips.sh
index c1cc4c6e..ebe817a6 100755
--- a/func/fetch_compute_ips.sh
+++ b/func/fetch_compute_ips.sh
@@ -41,7 +41,7 @@ verify_connectivity(){
:${DEPLOY_TYPE:=''}
#Getoptions
-whilegetopts ":d:i:a:h:v" optchar; do
+while getopts ":i:a:h:v" optchar; do
case "${optchar}" in
i) installer_type=${OPTARG} ;;
a) installer_ip=${OPTARG} ;;
@@ -57,7 +57,7 @@ done
installer_type=${installer_type:-$INSTALLER_TYPE}
installer_ip=${installer_ip:-$INSTALLER_IP}
-if[ -z $installer_type ] || [ -z $installer_ip ]; then
+if [ -z $installer_type ] || [ -z $installer_ip ]; then
usage
exit 2
fi
@@ -65,7 +65,7 @@ fi
ssh_options="-oUserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
#Start fetching compute ip
-if[ "$installer_type" == "fuel" ]; then
+if [ "$installer_type" == "fuel" ]; then
verify_connectivity $installer_ip
env=$(sshpass -p r00tme ssh 2>/dev/null $ssh_options root@${installer_ip} \
@@ -81,11 +81,11 @@ if[ "$installer_type" == "fuel" ]; then
sed 's/ //g') &> /dev/null
-elif[ "$installer_type" == "apex" ]; then
+elif [ "$installer_type" == "apex" ]; then
echo "not implement now"
exit 1
-elif[ "$installer_type" == "compass" ]; then
+elif [ "$installer_type" == "compass" ]; then
# need test
verify_connectivity $installer_ip
IPS=$(sshpass -p'root' ssh 2>/dev/null $ssh_options root@${installer_ip} \
@@ -93,11 +93,11 @@ elif[ "$installer_type" == "compass" ]; then
| awk -F"," '{for(i=1;i<NF;i++)if($i~/\"host[4-5]\"/) {print $(i+1);}}' \
| grep -oP "\d+.\d+.\d+.\d+")
-elif[ "$installer_type" == "joid" ]; then
+elif [ "$installer_type" == "joid" ]; then
echo "not implement now"
exit 1
-elif[ "$installer_type" == "foreman" ]; then
+elif [ "$installer_type" == "foreman" ]; then
echo "not implement now"
exit 1
@@ -105,7 +105,7 @@ else
error "Installer $installer is not supported by this script"
fi
-if[ -z $IPS ]; then
+if [ -z "$IPS" ]; then
error "The compute node $IPS are not up. Please check that the POD is correctly deployed."
else
echo "-------- all compute node ips: --------"
@@ -114,4 +114,4 @@ else
echo $IPS
fi
-exit0
+exit 0