X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=ci%2Fdeploy.sh;h=066b457b491ed1c86235e4f6dc2bb220a00c0510;hb=e4212ab9dc23be9d0aa9f2593e20c78aa0e9c2c2;hp=3985896e1fe192414ac6e046ef5df78ef71a8d84;hpb=22a84bad2e15472fe3ea181aca35e7c48afb054f;p=joid.git diff --git a/ci/deploy.sh b/ci/deploy.sh index 3985896e..066b457b 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -2,7 +2,7 @@ set -ex -source tools.sh +source common/tools.sh #need to put multiple cases here where decide this bundle to deploy by default use the odl bundle. # Below parameters are the default and we can according the release @@ -202,16 +202,18 @@ deploy() { PROFILE=${PROFILE:-ubuntu} MAAS_IP=$(grep " ip_address" deployconfig.yaml | cut -d ':' -f 2 | sed -e 's/ //') API_SERVER="http://$MAAS_IP:5240/MAAS/api/2.0" - API_KEY=`sudo maas-region apikey --username=ubuntu` - maas login $PROFILE $API_SERVER $API_KEY - - # make sure there is no machine entry in maas - for m in $(maas $PROFILE machines read | jq -r '.[].system_id') - do - maas $PROFILE machine delete $m || true - done - maas $PROFILE pod delete 1 || true - + if which maas > /dev/null; then + API_KEY=`sudo maas-region apikey --username=ubuntu` + maas login $PROFILE $API_SERVER $API_KEY + + # make sure there is no machine entry in maas + for m in $(maas $PROFILE machines read | jq -r '.[].system_id') + do + maas $PROFILE machine delete $m || true + done + podno=$(maas $PROFILE pods read | jq -r ".[]".id) + maas $PROFILE pod delete $podno || true + fi ./cleanvm.sh || true if [ "$virtinstall" -eq 1 ]; then