summaryrefslogtreecommitdiffstats
path: root/ci/02-deploybundle.sh
diff options
context:
space:
mode:
authorNarinder Gupta <narinder.gupta@canonical.com>2017-01-20 15:43:59 -0600
committerNarinder Gupta <narinder.gupta@canonical.com>2017-01-20 15:43:59 -0600
commitf7841591292babc2eb36eb512b72b1241d066611 (patch)
tree2aad9030fe0690bce2c706d211877b3e6b229276 /ci/02-deploybundle.sh
parentfa4ba2104f686d00402203f5c36be2275098dd49 (diff)
adjusted as per maas version.
Change-Id: I0ead201e0c52a141640644d0329aa550e4f4cb3f Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
Diffstat (limited to 'ci/02-deploybundle.sh')
-rwxr-xr-xci/02-deploybundle.sh20
1 files changed, 17 insertions, 3 deletions
diff --git a/ci/02-deploybundle.sh b/ci/02-deploybundle.sh
index 1bb8e353..b634ec8d 100755
--- a/ci/02-deploybundle.sh
+++ b/ci/02-deploybundle.sh
@@ -20,6 +20,7 @@ else
fi
jujuver=`juju --version`
+maasver=`apt-cache policy maas | grep Installed | cut -d ':' -f 2 | sed -e 's/ //'`
#modify the ubuntu series wants to deploy
sed -i -- "s|distro=trusty|distro=$opnfvdistro|g" ./fetch-charms.sh
@@ -56,10 +57,19 @@ 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 || true`
+if [ "$maasver" > "2" ]; then
+ API_KEY=`sudo maas-region apikey --username=ubuntu || true`
+else
+ API_KEY=`sudo maas-region-admin apikey --username=ubuntu || true`
+fi
+
if [[ "$API_KEY" = "" ]]; then
- API_KEY=`sshpass -p ubuntu ssh ubuntu@$MAAS_IP 'sudo maas-region apikey --username=ubuntu'`
+ if [ "$maasver" > "2" ]; then
+ API_KEY=`sshpass -p ubuntu ssh ubuntu@$MAAS_IP 'sudo maas-region apikey --username=ubuntu'`
+ else
+ API_KEY=`sshpass -p ubuntu ssh ubuntu@$MAAS_IP 'sudo maas-region-admin apikey --username=ubuntu'`
+ fi
fi
maas login $PROFILE $API_SERVERMAAS $API_KEY
@@ -74,7 +84,11 @@ if [[ "$opnfvmodel" = "openstack" ]]; then
osdomname=`grep "os-domain-name" deployconfig.yaml | cut -d ':' -f 2 | sed -e 's/ //'`
fi
- workmutiple=`maas maas nodes read | grep "cpu_count" | cut -d ':' -f 2 | sed -e 's/ //' | tr ',' ' '`
+ if [ "$maasver" > "2" ]; then
+ workmutiple=`maas maas nodes read | grep "cpu_count" | cut -d ':' -f 2 | sed -e 's/ //' | tr ',' ' '`
+ else
+ workmutiple=`maas maas nodes list | grep "cpu_count" | cut -d ':' -f 2 | sed -e 's/ //' | tr ',' ' '`
+ fi
max=0
for v in ${workmutiple[@]}; do
if (( $v > $max )); then max=$v; fi;