summaryrefslogtreecommitdiffstats
path: root/bifrost/scripts
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2017-01-27 15:17:54 +0000
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2017-08-11 12:56:12 -0700
commit482e69470df85abb82649873dc37cba13284884c (patch)
treeb78a70097606b8e8e077ccee56efe427e95cfa6a /bifrost/scripts
parente893fc381e02f149a10aacaa41417b0f4158a3d2 (diff)
jjb: infra: prototypes: bifrost: Ignore mysql and ironic failures
On brand new hosts ironic may not be installed yet so attemping to restart ironic services will lead to failures. Similarly, mysql may also not be installed so do not try to wipe the tables. Change-Id: Ic77d9358aeecb11f5c076a47cfea18ee4f0dff9f Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'bifrost/scripts')
-rwxr-xr-xbifrost/scripts/destroy-env.sh18
1 files changed, 10 insertions, 8 deletions
diff --git a/bifrost/scripts/destroy-env.sh b/bifrost/scripts/destroy-env.sh
index cdc55df1..9920046e 100755
--- a/bifrost/scripts/destroy-env.sh
+++ b/bifrost/scripts/destroy-env.sh
@@ -21,13 +21,15 @@ virsh undefine jumphost.opnfvlocal || true
virsh undefine controller00.opnfvlocal || true
virsh undefine compute00.opnfvlocal || true
-service ironic-conductor stop
+service ironic-conductor stop || true
echo "removing from database"
-mysql -u root ironic --execute "truncate table ports;"
-mysql -u root ironic --execute "delete from node_tags;"
-mysql -u root ironic --execute "delete from nodes;"
-mysql -u root ironic --execute "delete from conductors;"
+if $(which mysql &> /dev/null); then
+ mysql -u root ironic --execute "truncate table ports;"
+ mysql -u root ironic --execute "delete from node_tags;"
+ mysql -u root ironic --execute "delete from nodes;"
+ mysql -u root ironic --execute "delete from conductors;"
+fi
echo "removing leases"
[[ -e /var/lib/misc/dnsmasq/dnsmasq.leases ]] && > /var/lib/misc/dnsmasq/dnsmasq.leases
echo "removing logs"
@@ -48,6 +50,6 @@ rm -rf /var/lib/libvirt/images/*.qcow2
echo "restarting services"
service dnsmasq restart || true
service libvirtd restart
-service ironic-api restart
-service ironic-conductor start
-service ironic-inspector restart
+service ironic-api restart || true
+service ironic-conductor start || true
+service ironic-inspector restart || true