summaryrefslogtreecommitdiffstats
path: root/tests/vHello_VES.sh
diff options
context:
space:
mode:
authorblsaws <bryan.sullivan@att.com>2016-10-23 19:49:56 +0000
committerblsaws <bryan.sullivan@att.com>2016-10-23 19:49:56 +0000
commitac118982bf77f435d81517c722cfa10ede661136 (patch)
treefca754979f99e661844005b7906c923b293979d9 /tests/vHello_VES.sh
parent1995784862923e2578dd93ebff68756c8fa4770b (diff)
Add removal steps for bare metal collectd agents
JIRA: VES-1 Change-Id: Ia5f70a41750da50df6cb5e83327c23b0e5b9816d Signed-off-by: blsaws <bryan.sullivan@att.com>
Diffstat (limited to 'tests/vHello_VES.sh')
-rw-r--r--tests/vHello_VES.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/vHello_VES.sh b/tests/vHello_VES.sh
index 62ce9c8..00a8361 100644
--- a/tests/vHello_VES.sh
+++ b/tests/vHello_VES.sh
@@ -297,6 +297,31 @@ stop() {
fip=($(neutron floatingip-list|grep -v "+"|grep -v id|awk '{print $2}')); for id in ${fip[@]}; do neutron floatingip-delete ${id}; done
sg=($(openstack security group list|grep vHello|awk '{print $2}'))
for id in ${sg[@]}; do try 10 5 "openstack security group delete ${id}"; done
+
+ echo "$0: $(date) remove collectd agent on bare metal hypervisor hosts"
+ hosts=($(openstack hypervisor list | grep -v Hostname | grep -v "+" | awk '{print $4}'))
+ for host in ${hosts[@]}; do
+ ip=$(openstack hypervisor show $host | grep host_ip | awk '{print $4}')
+ if [[ "$OS_CLOUDNAME" == "overcloud" ]]; then
+ u="heat-admin"
+ p=""
+ else
+ u="ubuntu"
+ p=":ubuntu"
+ fi
+ ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $u$p@$ip <<'EOF'
+if [[ $USER == "ubuntu" ]]; then
+ sudo service collectd stop
+ sudo apt-get remove -y collectd
+ sudo rm /etc/collectd/collectd.conf
+else
+ sudo service collectd stop
+ sudo yum remove -y collectd
+ sudo rm /etc/collectd.conf
+fi
+EOF
+ rm -rf $HOME/OpenStackBarcelonaDemo
+ done
}
#