summaryrefslogtreecommitdiffstats
path: root/ci/02-deploybundle.sh
diff options
context:
space:
mode:
authorNarinder Gupta <narinder.gupta@canonical.com>2017-01-12 09:51:03 -0600
committerNarinder Gupta <narinder.gupta@canonical.com>2017-01-12 09:51:45 -0600
commit3134224776bece970627c7ae8adef338f13136c1 (patch)
tree991cf1a9673f5b012b19ec644fd38da1d14dbf7e /ci/02-deploybundle.sh
parent5fbb32535bb6456989407a946587b1bcbe94d0ee (diff)
modified to include MAAS 2.0 on remote host.
Change-Id: If268a5ae1f0a103314f1ab742b495de3ffdb5efc Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
Diffstat (limited to 'ci/02-deploybundle.sh')
-rwxr-xr-xci/02-deploybundle.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/ci/02-deploybundle.sh b/ci/02-deploybundle.sh
index e34f3d70..6d2ead1c 100755
--- a/ci/02-deploybundle.sh
+++ b/ci/02-deploybundle.sh
@@ -56,7 +56,12 @@ check_status() {
PROFILE=maas
MAAS_IP=$(grep " ip_address" deployment.yaml | cut -d ':' -f 2 | sed -e 's/ //')
API_SERVERMAAS="http://$MAAS_IP/MAAS/"
-API_KEY=`sudo maas-region apikey --username=ubuntu`
+API_KEY=`sudo maas-region apikey --username=ubuntu || true`
+
+if [[ "$API_KEY" = "" ]]; then
+ API_KEY=`sshpass -p ubuntu ssh ubuntu@$MAAS_IP 'sudo maas-region apikey --username=ubuntu'`
+fi
+
maas login $PROFILE $API_SERVERMAAS $API_KEY
if [[ "$opnfvmodel" = "openstack" ]]; then