prototypes: bifrost: Drop the entire ironic database 17/27917/1
authorMarkos Chandras <mchandras@suse.de>
Thu, 2 Feb 2017 15:18:09 +0000 (15:18 +0000)
committerMarkos Chandras <mchandras@suse.de>
Thu, 2 Feb 2017 15:18:09 +0000 (15:18 +0000)
There is no reason to only drop a few tables from it, so
just drop the entire database.

Change-Id: Iea9757fc5ccd85bc223d3c86d6a4c3ecf65fa130
Signed-off-by: Markos Chandras <mchandras@suse.de>
prototypes/bifrost/scripts/destroy-env.sh

index 9920046..ba761c2 100755 (executable)
@@ -23,12 +23,9 @@ virsh undefine compute00.opnfvlocal || true
 
 service ironic-conductor stop || true
 
-echo "removing from database"
+echo "removing ironic database"
 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;"
+    mysql -u root ironic --execute "drop database ironic;"
 fi
 echo "removing leases"
 [[ -e /var/lib/misc/dnsmasq/dnsmasq.leases ]] && > /var/lib/misc/dnsmasq/dnsmasq.leases