summaryrefslogtreecommitdiffstats
path: root/ci/openstack.sh
diff options
context:
space:
mode:
authorGuo Ruijing <ruijing.guo@intel.com>2017-10-18 19:56:15 -0400
committerNarinder Gupta <narinder.gupta@canonical.com>2017-12-13 16:36:50 +0000
commitd27608283966794e0b93cd9ce12412f6ab8d16e4 (patch)
tree3901bc662f47e6ada1cc335322edddcb0bd9fbf2 /ci/openstack.sh
parent06afa960e508c999b9dd96488c1aef01f222fba0 (diff)
cleanup code
1. remove unused code due to juju>2 & maas>2.2 in Ubuntu16.04 2. remove deprecated 03-maasdeploy.sh 3. remove other unused code Change-Id: I20fd0e96400db1262b0df3ef2b502c8001dd5b76 Signed-off-by: Guo Ruijing <ruijing.guo@intel.com> (cherry picked from commit 2819ba063c1a9896ccf437f85ca4c2ee463d7e80)
Diffstat (limited to 'ci/openstack.sh')
-rwxr-xr-xci/openstack.sh32
1 files changed, 5 insertions, 27 deletions
diff --git a/ci/openstack.sh b/ci/openstack.sh
index a32bb998..a7d91fb6 100755
--- a/ci/openstack.sh
+++ b/ci/openstack.sh
@@ -17,8 +17,6 @@ opnfvlab=$2
opnfvdistro=$3
opnfvos=$4
-jujuver=`juju --version`
-
if [ -f ./deployconfig.yaml ];then
EXTERNAL_NETWORK=`grep floating-ip-range deployconfig.yaml | cut -d ' ' -f 4 `
@@ -49,38 +47,22 @@ update_gw_mac() {
## get gateway mac
EXTNET_GW_MAC=$(juju ssh nova-compute/0 "arp -a ${EXTNET_GW} | grep -Eo '([0-9a-fA-F]{2})(([/\s:-][0-9a-fA-F]{2}){5})'")
## set external gateway mac in onos
- if [[ "$jujuver" < "2" ]]; then
- juju set onos-controller gateway-mac=$EXTNET_GW_MAC
- else
- juju config onos-controller gateway-mac=$EXTNET_GW_MAC
- fi
+ juju config onos-controller gateway-mac=$EXTNET_GW_MAC
}
unitAddress() {
- if [[ "$jujuver" < "2" ]]; then
- juju status --format yaml | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"services\"][\"$1\"][\"units\"][\"$1/$2\"][\"public-address\"]" 2> /dev/null
- else
- juju status --format yaml | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"applications\"][\"$1\"][\"units\"][\"$1/$2\"][\"public-address\"]" 2> /dev/null
- fi
+ juju status --format yaml | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"applications\"][\"$1\"][\"units\"][\"$1/$2\"][\"public-address\"]" 2> /dev/null
}
unitMachine() {
- if [[ "$jujuver" < "2" ]]; then
- juju status --format yaml | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"services\"][\"$1\"][\"units\"][\"$1/$2\"][\"machine\"]" 2> /dev/null
- else
- juju status --format yaml | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"applications\"][\"$1\"][\"units\"][\"$1/$2\"][\"machine\"]" 2> /dev/null
- fi
+ juju status --format yaml | python -c "import yaml; import sys; print yaml.load(sys.stdin)[\"applications\"][\"$1\"][\"units\"][\"$1/$2\"][\"machine\"]" 2> /dev/null
}
keystoneIp() {
if [ $(juju status keystone --format=short | grep " keystone"|wc -l) == 1 ];then
unitAddress keystone 0
else
- if [[ "$jujuver" < "2" ]]; then
- juju get keystone | python -c "import yaml; import sys; print yaml.load(sys.stdin)['settings']['vip']['value']" | cut -d " " -f 1
- else
- juju config keystone | python -c "import yaml; import sys; print yaml.load(sys.stdin)['settings']['vip']['value']" | cut -d " " -f 1
- fi
+ juju config keystone | python -c "import yaml; import sys; print yaml.load(sys.stdin)['settings']['vip']['value']" | cut -d " " -f 1
fi
}
@@ -90,11 +72,7 @@ create_openrc() {
mkdir -m 0700 -p cloud
keystoneIp=$(keystoneIp)
- if [[ "$jujuver" < "2" ]]; then
- adminPasswd=$(juju get keystone | grep admin-password -A 5 | grep value | awk '{print $2}' 2> /dev/null)
- else
- adminPasswd=$(juju config keystone | grep admin-password -A 5 | grep value | awk '{print $2}' 2> /dev/null)
- fi
+ adminPasswd=$(juju config keystone | grep admin-password -A 5 | grep value | awk '{print $2}' 2> /dev/null)
v3api=`juju config keystone preferred-api-version`