recover MAAS 2.0 59/27559/1
authorNarinder Gupta <narinder.gupta@canonical.com>
Wed, 25 Jan 2017 18:41:32 +0000 (12:41 -0600)
committerNarinder Gupta <narinder.gupta@canonical.com>
Wed, 25 Jan 2017 18:41:32 +0000 (12:41 -0600)
code has been modified to recover the environment for MAAS 2.0 as
new deployment failed for MAAS 2.0

Change-Id: I80a0fab8f01a5600b04c7e95509f88617783215e
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
jjb/joid/joid-deploy.sh

index 88dbe22..da5dcf0 100644 (file)
@@ -45,17 +45,24 @@ export POD_NAME=${POD/-}
 ##
 
 cd $WORKSPACE/ci
-if [ -e "$LAB_CONFIG/environments.yaml" ] && [ "$MAAS_REINSTALL" == "false" ]; then
+
+if [ -e "$LAB_CONFIG/deployconfig.yaml" ] && [ "$MAAS_REINSTALL" == "false" ]; then
     echo "------ Recover Juju environment to use MAAS ------"
-    cp $LAB_CONFIG/environments.yaml .
-    cp $LAB_CONFIG/deployment.yaml .
-    if [ -e $LAB_CONFIG/deployconfig.yaml ]; then
+    if [ -e deployconfig.yaml ]; then
         cp $LAB_CONFIG/deployconfig.yaml .
+        cp $LAB_CONFIG/deployment.yaml .
+        cp $LAB_CONFIG/labconfig.yaml .
     fi
 else
-    echo "------ Redeploy MAAS ------"
-    ./00-maasdeploy.sh $POD_NAME
-    exit_on_error $? "MAAS Deploy FAILED"
+    if ["$NODE_NAME" == "default" ]; then
+        echo "------ Redeploy MAAS ------"
+        ./03-maasdeploy.sh default
+        exit_on_error $? "MAAS Deploy FAILED"
+    else
+        echo "------ Redeploy MAAS ------"
+        ./03-maasdeploy.sh custom $LAB_CONFIG/labconfig.yaml
+        exit_on_error $? "MAAS Deploy FAILED"
+    fi
 fi
 
 ##
@@ -142,7 +149,7 @@ if [ "$JOID_MODEL" == 'os' ]; then
 
   # export the openrc file by getting the one generated by joid and add SDN
   # controller for Functest
-  cp ./cloud/admin-openrc $JOID_ADMIN_OPENRC
+  cp ./cloud/admin-openrc $JOID_ADMIN_OPENRC
   cat << EOF >> $JOID_ADMIN_OPENRC
   export SDN_CONTROLLER=$SDN_CONTROLLER_IP
   export SDN_PASSWORD=$SDN_PASSWORD