summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorNarinder Gupta <narinder.gupta@canonical.com>2017-05-30 15:03:36 -0500
committerNarinder Gupta <narinder.gupta@canonical.com>2017-05-30 15:03:36 -0500
commitd2d7586c4959bbb4db265fd8aa41519b595856db (patch)
tree9802bec43877bb1a8b1ed85741fdb3da3862da26 /ci
parenta79062a98d941f186c83fcc47954d339c471632b (diff)
modify openstack commands to use openstack tools.
Change-Id: I8ffebc25bc21e1c9d4c1121bbc9ea293d9d82fae Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
Diffstat (limited to 'ci')
-rwxr-xr-xci/deploy.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh
index 7578d821..207482e2 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -225,13 +225,15 @@ if ([ $admin_gw ] && [ $admin_gw != "null" ]); then
# set default gateway to public api gateway
for cnt in $cnt_list; do
echo "changing default gw on $cnt"
- juju ssh $cnt "sudo ip r d default && sudo ip r a default via $public_api_gw";
- juju ssh $cnt "gw_dev=\$(ip r l | grep 'via $public_api_gw' | cut -d \ -f5) &&\
+ if ([ $public_api_gw ] && [ $public_api_gw != "null" ]); then
+ juju ssh $cnt "sudo ip r d default && sudo ip r a default via $public_api_gw";
+ juju ssh $cnt "gw_dev=\$(ip r l | grep 'via $public_api_gw' | cut -d \ -f5) &&\
sudo cp /etc/network/interfaces /etc/network/interfaces.bak &&\
echo 'removing old default gateway' &&\
sudo perl -i -pe 's/^\ *gateway $admin_gw\n$//' /etc/network/interfaces &&\
sudo perl -i -pe \"s/iface \$gw_dev inet static/iface \$gw_dev inet static\\n gateway $public_api_gw/\" /etc/network/interfaces \
";
+ fi
done
fi