From 9e5637a9fed516d3ba036bd80de66187ebaea216 Mon Sep 17 00:00:00 2001 From: Michael Stucki Date: Tue, 25 Aug 2015 14:36:59 +0200 Subject: [PATCH] Do not remove system bridge virbr0 --- lib/vagrant-lxc/action/gc_private_network_bridges.rb | 4 ++-- lib/vagrant-lxc/driver.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/vagrant-lxc/action/gc_private_network_bridges.rb b/lib/vagrant-lxc/action/gc_private_network_bridges.rb index 946283e..8bb31f8 100644 --- a/lib/vagrant-lxc/action/gc_private_network_bridges.rb +++ b/lib/vagrant-lxc/action/gc_private_network_bridges.rb @@ -35,8 +35,8 @@ module Vagrant if ! driver.bridge_is_in_use?(bridge) env[:ui].info I18n.t("vagrant_lxc.messages.remove_bridge", name: bridge) - if bridge != "lxcbr0" - driver.remove_bridge(bridge) + unless ['lxcbr0', 'virbr0'].include? bridge + driver.remove_bridge(bridge) end end end diff --git a/lib/vagrant-lxc/driver.rb b/lib/vagrant-lxc/driver.rb index 918dbd7..d205670 100644 --- a/lib/vagrant-lxc/driver.rb +++ b/lib/vagrant-lxc/driver.rb @@ -191,7 +191,7 @@ module Vagrant end def remove_bridge(bridge_name) - if bridge_name == "lxcbr0" + if ['lxcbr0', 'virbr0'].include? bridge_name @logger.info "Skipping removal system bridge #{bridge_name}" return end