From: David Galloway Date: Thu, 26 Mar 2026 21:29:23 +0000 (-0400) Subject: mgr/rook: handle inactive libvirt default network in recreate_default_network X-Git-Tag: v21.0.1~639^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2b4a1357564455a6ab3af242cb0d7a38f6616fb5;p=ceph.git mgr/rook: handle inactive libvirt default network in recreate_default_network net-destroy fails if the network exists but is already inactive, causing the script to exit before net-define is attempted. Check for this case and fall through to net-undefine directly so the network can be cleanly recreated regardless of its initial state. Signed-off-by: David Galloway --- diff --git a/src/pybind/mgr/rook/ci/scripts/bootstrap-rook-cluster.sh b/src/pybind/mgr/rook/ci/scripts/bootstrap-rook-cluster.sh index 0005e3f23f6..c8b56ccfb54 100755 --- a/src/pybind/mgr/rook/ci/scripts/bootstrap-rook-cluster.sh +++ b/src/pybind/mgr/rook/ci/scripts/bootstrap-rook-cluster.sh @@ -152,9 +152,12 @@ configure_libvirt(){ recreate_default_network(){ - # destroy any existing kvm default network - if sudo virsh net-destroy default; then - sudo virsh net-undefine default + # destroy and undefine any existing default network, active or not + if sudo virsh net-destroy default 2>/dev/null; then + sudo virsh net-undefine default + elif sudo virsh net-info default &>/dev/null; then + # network exists but is already inactive, just undefine it + sudo virsh net-undefine default fi # let's create a new kvm default network