mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Allow bridges referenced by libvirt networks (#1554)
Permit reference to bridge devices referenced by existing libvirt networks. Fixes: #1553
This commit is contained in:
@@ -1213,7 +1213,11 @@ module VagrantPlugins
|
||||
|
||||
def host_devices(machine)
|
||||
@host_devices ||= begin
|
||||
machine.provider.driver.connection.client.list_all_interfaces().map { |iface| iface.name }.uniq.select do |dev|
|
||||
(
|
||||
machine.provider.driver.list_host_devices.map { |iface| iface.name } +
|
||||
machine.provider.driver.list_networks.map { |net| net.bridge_name }
|
||||
).uniq.select do |dev|
|
||||
next if dev.empty?
|
||||
dev != "lo" && !@host_device_exclude_prefixes.any? { |exclude| dev.start_with?(exclude) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -201,6 +201,14 @@ module VagrantPlugins
|
||||
state
|
||||
end
|
||||
|
||||
def list_host_devices
|
||||
@connection.client.list_all_interfaces
|
||||
end
|
||||
|
||||
def list_networks
|
||||
@connection.client.list_all_networks
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def get_ipaddress_from_system(mac)
|
||||
|
||||
Reference in New Issue
Block a user