From 777b80b817b051feb97f51721560ebf4561c55d2 Mon Sep 17 00:00:00 2001 From: zhongjun Date: Wed, 28 Jun 2017 13:48:29 +0800 Subject: Add scenario arg check Add the scenario argument valid check in deploy.sh. Change-Id: Ifeeed3882b22ba379975c2356d761e0536c5c2c9 Signed-off-by: zhongjun --- ci/deploy/deploy.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'ci') diff --git a/ci/deploy/deploy.sh b/ci/deploy/deploy.sh index e2923a1d..d01d3509 100755 --- a/ci/deploy/deploy.sh +++ b/ci/deploy/deploy.sh @@ -40,7 +40,7 @@ Examples: sudo `basename $0` -b base_path -l zte -p pod2 -B pxebr -d ./deploy/config/vm_environment/zte-virtual1/deploy.yml - -r /opt/daisy -w /opt/daisy + -r /opt/daisy -w /opt/daisy -s os-nosdn-nofeature-noha xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx EOF } @@ -63,6 +63,7 @@ TARGET_HOSTS_NUM=0 DRY_RUN=0 IS_BARE=1 VM_MULTINODE=("computer01" "computer02" "computer03" "computer04" "controller01") +VALID_DEPLOY_SCENARIO=("os-nosdn-nofeature-noha" "os-odl_l3-nofeature-noha" "os-odl_l2-nofeature-noha") # # END of variables to customize ############################################################################ @@ -181,6 +182,7 @@ if [ $DRY_RUN -eq 1 ]; then VMDEPLOY_TARGET_NODE_NET: $VMDEPLOY_TARGET_NODE_NET VMDEPLOY_DAISY_SERVER_VM: $VMDEPLOY_DAISY_SERVER_VM VMDEPLOY_TARGET_NODE_VM: $VMDEPLOY_TARGET_NODE_VM + DEPLOY_SCENARIO: $DEPLOY_SCENARIO """ exit 1 fi @@ -195,6 +197,25 @@ fi test -d ${VM_STORAGE} || mkdir -p ${VM_STORAGE} +function check_scenario_arg +{ + local is_valid_scenario=0 + + for item in ${VALID_DEPLOY_SCENARIO[@]};do + if [ ${DEPLOY_SCENARIO} == $item ]; then + is_valid_scenario=1 + break + fi + done + + if [ $is_valid_scenario -eq 0 ]; then + echo "Invalid scenario argument:${DEPLOY_SCENARIO}" + exit 1 + fi +} + +check_scenario_arg + function create_node { local net_template=$1 -- cgit 1.2.3-korg