Merge pull request #383 from stucki/use-system-bridge

Use system bridge
This commit is contained in:
Franz Pletz 2015-08-25 15:20:11 +02:00
commit 78ef85aa97
2 changed files with 8 additions and 2 deletions

View file

@ -35,8 +35,9 @@ module Vagrant
if ! driver.bridge_is_in_use?(bridge)
env[:ui].info I18n.t("vagrant_lxc.messages.remove_bridge", name: bridge)
# TODO: Output that bridge is being removed
driver.remove_bridge(bridge)
unless ['lxcbr0', 'virbr0'].include? bridge
driver.remove_bridge(bridge)
end
end
end
end

View file

@ -170,6 +170,11 @@ module Vagrant
end
def remove_bridge(bridge_name)
if ['lxcbr0', 'virbr0'].include? bridge_name
@logger.info "Skipping removal of system bridge #{bridge_name}"
return
end
@logger.info "Checking whether bridge #{bridge_name} exists"
brctl_output = `ifconfig -a | grep -q #{bridge_name}`
return if $?.to_i != 0