Only call destroy on active networks (#1497)

When removing networks, skip calling destroy to deactivate the network
if it is not currently active. This avoids errors when the host has been
rebooted and vagrant machines are removed as the networks are typically
not automatically started.
This commit is contained in:
Darragh Bailey
2022-05-19 14:18:22 +01:00
committed by GitHub
parent f498f102e1
commit d1232f0c20

View File

@@ -68,7 +68,7 @@ module VagrantPlugins
# Shutdown network first.
# Undefine network.
begin
libvirt_network.destroy
libvirt_network.destroy if libvirt_network.active?
libvirt_network.undefine
@logger.info 'Undefined it'
rescue => e