summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
Diffstat (limited to 'ci')
-rwxr-xr-xci/02-deploybundle.sh7
-rwxr-xr-xci/03-maasdeploy.sh2
2 files changed, 7 insertions, 2 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
diff --git a/ci/03-maasdeploy.sh b/ci/03-maasdeploy.sh
index 0a934c20..498c3f92 100755
--- a/ci/03-maasdeploy.sh
+++ b/ci/03-maasdeploy.sh
@@ -25,7 +25,7 @@ sudo apt-get update -y
sudo apt-get dist-upgrade -y
sudo apt-get install openssh-server bzr git juju virtinst qemu-kvm libvirt-bin \
maas maas-region-controller python-pip python-psutil python-openstackclient \
- python-congressclient gsutil charm-tools pastebinit python-jinja2 -y
+ python-congressclient gsutil charm-tools pastebinit python-jinja2 sshpass -y
sudo pip install --upgrade pip