mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
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:
@@ -68,7 +68,7 @@ module VagrantPlugins
|
|||||||
# Shutdown network first.
|
# Shutdown network first.
|
||||||
# Undefine network.
|
# Undefine network.
|
||||||
begin
|
begin
|
||||||
libvirt_network.destroy
|
libvirt_network.destroy if libvirt_network.active?
|
||||||
libvirt_network.undefine
|
libvirt_network.undefine
|
||||||
@logger.info 'Undefined it'
|
@logger.info 'Undefined it'
|
||||||
rescue => e
|
rescue => e
|
||||||
|
|||||||
Reference in New Issue
Block a user