summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorNarinder Gupta <narinder.gupta@canonical.com>2017-08-18 16:31:05 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-18 16:31:05 +0000
commit8bdde6b0cd0a47002d56b501fc317220faae959e (patch)
tree78af64ec177bbd774e564cf1cecf9436036d9f1f /ci
parent31d78619092ba930f94f19599a677842ca66d216 (diff)
parentdd132e89e0e38ed3b42462911ad7e2e7052673d5 (diff)
Merge "check if maas exist the only delete pod."
Diffstat (limited to 'ci')
-rwxr-xr-xci/deploy.sh23
1 files changed, 12 insertions, 11 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh
index 2792759f..8a08f57d 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -202,17 +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
- podno=$(maas $PROFILE pods read | jq -r ".[]".id)
- maas $PROFILE pod delete $podno || 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