Merge pull request #383 from stucki/use-system-bridge
Use system bridge
This commit is contained in:
commit
78ef85aa97
2 changed files with 8 additions and 2 deletions
|
@ -35,7 +35,7 @@ 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
|
||||
unless ['lxcbr0', 'virbr0'].include? bridge
|
||||
driver.remove_bridge(bridge)
|
||||
end
|
||||
end
|
||||
|
@ -43,4 +43,5 @@ module Vagrant
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue