From: David Galloway Date: Thu, 18 May 2017 19:47:05 +0000 (-0400) Subject: scripts: Be more aggressive with libvirt network destruction X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F730%2Fhead;p=ceph-build.git scripts: Be more aggressive with libvirt network destruction See https://github.com/vagrant-libvirt/vagrant-libvirt/issues/670#issuecomment-261964248 Can confirm that deleting the default network still allows vagrant-libvirt to run fine on Ubuntu 16.04. Signed-off-by: David Galloway --- diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index 6817bbfc..6cc5258b 100644 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -423,7 +423,7 @@ delete_libvirt_vms() { clear_libvirt_networks() { # Sometimes, networks may linger around, so we must ensure they are killed: - networks=`sudo virsh net-list --all | grep active | egrep -v "(default|libvirt)" | cut -d ' ' -f 2` + networks=`sudo virsh net-list --all --name` for network in $networks; do sudo virsh net-destroy $network || true sudo virsh net-undefine $network || true