Ignore Windows NICs with nil :net_connection_id

When upping a Win XP box, vagrant found a lot of "virtual" network
connections that did not have DHCP enabled, and tried to configure them
for DHCP. This did not work because their :net_connection_id is nil.
Ignoring these network connections enabled the XP box to be upped.
This commit is contained in:
Ben Jansen 2015-03-13 11:42:55 -07:00
parent a8dcf92f14
commit 992c148169
1 changed files with 3 additions and 1 deletions

View File

@ -64,7 +64,9 @@ module VagrantPlugins
guest_network.network_adapters.each do |nic|
@@logger.debug("nic: #{nic.inspect}")
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]] = {
net_connection_id: nic[:net_connection_id],
mac_address: naked_mac,