Merge pull request #5478 from aogail/ignore-windows-virtual-network-connections

Ignore Windows NICs with nil :net_connection_id
This commit is contained in:
Seth Vargo 2015-05-31 20:10:08 -07:00
commit 624a3200f3
1 changed files with 3 additions and 1 deletions

View File

@ -64,7 +64,9 @@ module VagrantPlugins
guest_network.network_adapters.each do |nic| guest_network.network_adapters.each do |nic|
@@logger.debug("nic: #{nic.inspect}") @@logger.debug("nic: #{nic.inspect}")
naked_mac = nic[:mac_address].gsub(':','') naked_mac = nic[:mac_address].gsub(':','')
if driver_mac_address[naked_mac] # If the :net_connection_id entry is nil then it is probably a virtual connection
# and should be ignored.
if driver_mac_address[naked_mac] && !nic[:net_connection_id].nil?
vm_interface_map[driver_mac_address[naked_mac]] = { vm_interface_map[driver_mac_address[naked_mac]] = {
net_connection_id: nic[:net_connection_id], net_connection_id: nic[:net_connection_id],
mac_address: naked_mac, mac_address: naked_mac,