]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Delete networks when erasing OpenStack
authorZane Bitter <zbitter@redhat.com>
Fri, 18 May 2012 12:02:39 +0000 (14:02 +0200)
committerZane Bitter <zbitter@redhat.com>
Fri, 18 May 2012 20:42:37 +0000 (22:42 +0200)
This is required to remove any network interfaces created using nova. If
these are left behind they prevent a new installation of OpenStack
re-adding them.

Signed-off-by: Zane Bitter <zbitter@redhat.com>
tools/openstack

index e205b6b7d132d989eec8fda73045388b1585ef6c..8b7110f5e24f78ec9039812e455f9403900d1eda 100755 (executable)
@@ -63,11 +63,22 @@ function os_stop() {
 }
 
 function os_erase() {
+       for net in `sudo nova-manage network list |
+                   awk '/^[[:digit:]]/ { print $9 }'`
+       do
+               sudo nova-manage network delete --uuid $net
+       done
+
        os_stop
        sleep 1
+
+       # Kill dnsmasq processes
+       if find /var/lib/nova/networks -name '*.pid'; then
+               sudo kill `cat /var/lib/nova/networks/*.pid`
+       fi
+
        sudo rm -f /var/lib/libvirt/qemu/save/instance-000*
        sudo rm -f /var/lib/libvirt/qemu/instance-000*
-       for iii in /usr/lib/systemd/system/openstack-*.service; do sudo systemctl stop $(basename $iii); done
        sudo yum erase -y python-glance python-nova* python-keystone* openstack-swift* openstack-dashboard
 
        sudo systemctl start mysqld.service