From 2f8308425637ba4c5c2c3213fdd5d1283db62f21 Mon Sep 17 00:00:00 2001 From: Narinder Gupta Date: Tue, 12 Sep 2017 13:04:44 -0500 Subject: [PATCH] make sure MAAS gets deployed first before calling juju command. Change-Id: Ib9e122416d45625883ff1967e9089ec2ab4812a2 Signed-off-by: Narinder Gupta --- ci/deploy.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ci/deploy.sh b/ci/deploy.sh index b722d2ae..d4c30d9d 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -20,8 +20,6 @@ opnfvmodel=openstack virtinstall=0 maasinstall=0 -jujuver=`juju --version` - usage() { echo "Usage: $0 [-s|--sdn ] [-t|--type ] @@ -33,7 +31,7 @@ usage() { echo "Usage: $0 [-m|--model ] [-i|--virtinstall <0|1>] [--maasinstall <0|1>] - [--labfile ] + [--labfile ] [-r|--release ]" 1>&2 exit 1; } @@ -199,14 +197,14 @@ deploy() { python genDeploymentConfig.py -l labconfig.yaml > deployconfig.yaml fi else - echo_error "MAAS not deployed please deploy MAAS first." + if [ "$maasinstall" -eq 0 ]; then + echo_error "MAAS not deployed please deploy MAAS first." + else + echo_info "MAAS not deployed this will deploy MAAS first." + fi fi fi - #create json file which is missing in case of new deployment after maas and git tree cloned freshly. - python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < labconfig.yaml > labconfig.json - python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < deployconfig.yaml > deployconfig.json - # Install MAAS and expecting the labconfig.yaml at local directory. if [ "$maasinstall" -eq 1 ]; then @@ -254,6 +252,10 @@ deploy() { fi fi + #create json file which is missing in case of new deployment after maas and git tree cloned freshly. + python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < labconfig.yaml > labconfig.json + python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < deployconfig.yaml > deployconfig.json + if [[ "$opnfvtype" = "ha" && "$opnfvlab" = "default" ]]; then createresource fi @@ -315,6 +317,8 @@ juju status --format=tabular # translate bundle.yaml to json python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < bundles.yaml > bundles.json +jujuver=`juju --version` + # Configuring deployment if ([ $opnfvmodel == "openstack" ]); then echo_info "Configuring OpenStack deployment" -- 2.16.6