summaryrefslogtreecommitdiffstats
path: root/components/congress/joid/clean_congress.sh
diff options
context:
space:
mode:
authorblsaws <bs3131@att.com>2016-02-18 16:13:31 -0800
committerblsaws <bs3131@att.com>2016-04-01 08:30:07 -0700
commiteb27b050e3729c6a89ded2c6d65d34be9470c320 (patch)
treeac1180be73f14ecbefa2c91bf6c4e138242aa9b1 /components/congress/joid/clean_congress.sh
parent66884bd2539892d114fdc27c2ee606fcd46b3dd9 (diff)
correct "set" commands. use "source" instead of "sh".
add lxc-destroy to cleanup script. JIRA: COPPER-2 Change-Id: I3436ad4958405a71bc28ce4ed9b0a7ff0a596b6f Signed-off-by: blsaws <bs3131@att.com>
Diffstat (limited to 'components/congress/joid/clean_congress.sh')
-rw-r--r--components/congress/joid/clean_congress.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/components/congress/joid/clean_congress.sh b/components/congress/joid/clean_congress.sh
index 4d8d7b7..2afc0b3 100644
--- a/components/congress/joid/clean_congress.sh
+++ b/components/congress/joid/clean_congress.sh
@@ -18,17 +18,24 @@
# LXC container in the OPNFV Controller node.
# Presumably something has failed, and any record of the Congress feature
# in OpenStack needs to be removed, so you can try the install again.
-# Most of the items removed by this script were created in install_congress_5.sh
source ~/admin-openrc.sh <<EOF
openstack
EOF
+source ~/env.sh
+set -x echo on
+juju ssh ubuntu@node1-control "sudo lxc-stop --name juju-trusty-congress; sudo lxc-destroy --name juju-trusty-congress; exit"
# Delete Congress user
export CONGRESS_USER=$(openstack user list | awk "/ congress / { print \$2 }")
-openstack user delete $CONGRESS_USER
+if [ "$CONGRESS_USER" != "" ]; then
+ openstack user delete $CONGRESS_USER
+fi
# Delete Congress service
export CONGRESS_SERVICE=$(openstack service list | awk "/ congress / { print \$2 }")
-openstack service delete $CONGRESS_SERVICE
+if [ "$CONGRESS_SERVICE" != "" ]; then
+ openstack service delete $CONGRESS_SERVICE
+fi
+set -x echo off