summaryrefslogtreecommitdiffstats
path: root/components
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
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')
-rw-r--r--components/congress/joid/clean_congress.sh13
-rw-r--r--components/congress/joid/install_congress_1.sh2
-rw-r--r--components/congress/joid/install_congress_2.sh2
-rw-r--r--components/congress/joid/install_congress_3.sh6
-rw-r--r--components/congress/joid/install_congress_4.sh3
5 files changed, 18 insertions, 8 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
diff --git a/components/congress/joid/install_congress_1.sh b/components/congress/joid/install_congress_1.sh
index 9b9d64d..f2fc4da 100644
--- a/components/congress/joid/install_congress_1.sh
+++ b/components/congress/joid/install_congress_1.sh
@@ -24,5 +24,5 @@
# next: see install_congress_3.sh
juju scp ~/git/copper/components/congress/joid/install_congress_2.sh ubuntu@node1-control:/home/ubuntu
-juju ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ubuntu@node1-control "source ~/install_congress_2.sh; exit"
+juju ssh ubuntu@node1-control "source ~/install_congress_2.sh; exit"
return
diff --git a/components/congress/joid/install_congress_2.sh b/components/congress/joid/install_congress_2.sh
index 01b1533..5dedf75 100644
--- a/components/congress/joid/install_congress_2.sh
+++ b/components/congress/joid/install_congress_2.sh
@@ -22,7 +22,9 @@
# source ~/git/copper/components/congress/joid/install_congress_1.sh
# (copies install_congress_2.sh to node1-control and executes it)
+set -x
sudo lxc-clone -o juju-trusty-lxc-template -n juju-trusty-congress
sudo lxc-start -n juju-trusty-congress -d
sleep 10
sudo lxc-info -n juju-trusty-congress
+set +x
diff --git a/components/congress/joid/install_congress_3.sh b/components/congress/joid/install_congress_3.sh
index bf3b31e..6f094fb 100644
--- a/components/congress/joid/install_congress_3.sh
+++ b/components/congress/joid/install_congress_3.sh
@@ -25,7 +25,10 @@
# - Congress server IP address as discovered in lxc-info above
# source ~/git/copper/components/congress/joid/install_congress_3.sh
-ssh-keygen -f "/home/opnfv/.ssh/known_hosts" -R $1
+#ssh-keygen -f "/home/opnfv/.ssh/known_hosts" -R $1
+if (($? > 0)); then
+ return
+fi
cat <<EOF >~/env.sh
export CONGRESS_HOST=$1
export KEYSTONE_HOST=$(juju status --format=short | awk "/keystone\/0/ { print \$3 }")
@@ -40,4 +43,3 @@ juju scp ~/admin-openrc.sh ubuntu@$CONGRESS_HOST:/home/ubuntu
juju scp ~/env.sh ubuntu@$CONGRESS_HOST:/home/ubuntu
juju scp ~/git/copper/components/congress/joid/install_congress_4.sh ubuntu@$CONGRESS_HOST:/home/ubuntu
ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ubuntu@$CONGRESS_HOST "source ~/install_congress_4.sh; exit"
-return
diff --git a/components/congress/joid/install_congress_4.sh b/components/congress/joid/install_congress_4.sh
index 3248bec..a96cc7a 100644
--- a/components/congress/joid/install_congress_4.sh
+++ b/components/congress/joid/install_congress_4.sh
@@ -45,7 +45,6 @@ sudo -E apt-get -q -y install mysql-server python-mysqldb
sudo pip install virtualenvsource ~/admin-openrc.sh <<EOF
openstack
EOF
-source ~/env.sh
# clone congressedit congress.conf.sample as needed
mkdir ~/git
@@ -186,4 +185,4 @@ openstack congress datasource create keystone "keystone" \
# Run Congress Tempest Tests
cd ~/git/congress
# tox -epy27
-
+return