# Add the cloud and controller credentials for MAAS for that lab.
jujuver=`juju --version`
-if [ "$jujuver" -ge "2" ]; then
+if [ "$jujuver" > "2" ]; then
addcloud
addcredential
fi
jujuver=`juju --version`
-if [ "$jujuver" -lt "2" ]; then
+if [ "$jujuver" < "2" ]; then
juju bootstrap --debug --to bootstrap.maas
sleep 5
#disable juju gui until xenial charms are in charm store.
var=$var"_"publicapi
fi
-if [ "$jujuver" -lt "2" ]; then
+if [ "$jujuver" < "2" ]; then
#lets generate the bundle for all target using genBundle.py
python genBundle.py -j 1 -l deployconfig.yaml -s $var > bundles.yaml
#keep the back in cloud for later debugging.
set -ex
if [ ! -d environments.yaml ]; then
- cp ~/joid_config/environments.yaml ./environments.yaml
+ cp ~/joid_config/environments.yaml ./environments.yaml || true
+ cp ~/.juju/environments.yaml ./environments.yaml || true
fi
jujuver=`juju --version`
-if [ "$jujuver" -ge "2" ]; then
+if [ "$jujuver" > "2" ]; then
controllername=`awk 'NR==1{print $2}' environments.yaml`
cloudname=`awk 'NR==1{print $2}' environments.yaml`
juju kill-controller $controllername --timeout 10s -y || true
opnfvdistro=xenial
opnfvarch=amd64
+jujuver=`juju --version`
+
read_config() {
opnfvrel=`grep release: deploy.yaml | cut -d ":" -f2`
openstack=`grep openstack: deploy.yaml | cut -d ":" -f2`
./openstack.sh "$opnfvsdn" "$opnfvlab" "$opnfvdistro" "$openstack" || true
# creating heat domain after puching the public API into /etc/hosts
-status=`juju action do heat/0 domain-setup`
-echo $status
+
+if [ "$jujuver" > "2" ]; then
+ status=`juju run-action do heat/0 domain-setup`
+ echo $status
+else
+ status=`juju action do heat/0 domain-setup`
+ echo $status
+fi
+
sudo ../juju/get-cloud-images || true
../juju/joid-configure-openstack || true