Commit 02f299a5 authored by Dan Radez's avatar Dan Radez

arg parse updates

- replacing the echo | cut with bash string slicing
- replacing underscores with dashes in long args
- adding no-ha to the usage display

Change-Id: Ie87709c60a485bbcd97f168207e03d43bd85f24a
parent 9adcc896
......@@ -275,8 +275,8 @@ display_usage() {
echo -e "\n -c|--config : Full path of settings file to parse. Optional. Will provide a new base settings file rather than the default. Example: --config /opt/myinventory.yml \n"
echo -e "\n -r|--resources : Full path of settings file to parse. Optional. Will provide a new base settings file rather than the default. Example: --config /opt/myinventory.yml \n"
echo -e "\n -v|--virtual : Virtualize compute nodes instead of using baremetal. \n"
echo -e "\n --ping_site : site to use to verify IP connectivity from the VM when -virtual is used. Format: -ping_site www.blah.com \n"
echo -e "\n --floating_ip_count : number of IP address from the public range to be used for floating IP. Default is 20.\n"
echo -e "\n -p|--ping-site : site to use to verify IP connectivity from the VM when -virtual is used. Format: -ping_site www.blah.com \n"
echo -e "\n -n|--no-ha : disable High Availablility deploymnet scheme, this assumes a single controller and single compute node \n"
}
##translates the command line paramaters into variables
......@@ -287,7 +287,7 @@ parse_cmdline() {
echo "Use -h to display help"
sleep 2
while [ "$(echo $1 | cut -c1)" = "-" ]
while [ "${1:0:1}" = "-" ]
do
echo $1
case "$1" in
......@@ -307,15 +307,11 @@ parse_cmdline() {
virtual="TRUE"
shift 1
;;
--ping_site)
-p|--ping-site)
ping_site=$2
shift 2
;;
--floating_ip_count)
floating_ip_count=$2
shift 2
;;
-n|--no_ha )
-n|--no-ha )
vm_index=1
shift 1
;;
......@@ -325,10 +321,6 @@ parse_cmdline() {
;;
esac
done
if [ -z "$floating_ip_count" ]; then
floating_ip_count=20
fi
}
##END FUNCTIONS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment