lib/vagrant-windows/guest/cap/configure_networks.rb in vagrant-windows-1.2.0 vs lib/vagrant-windows/guest/cap/configure_networks.rb in vagrant-windows-1.2.1
- old
+ new
@@ -1,9 +1,10 @@
require 'log4r'
require_relative '../../communication/guestnetwork'
require_relative '../../communication/winrmshell'
require_relative '../../errors'
+require_relative '../../helper'
module VagrantWindows
module Guest
module Cap
class ConfigureNetworks
@@ -12,12 +13,11 @@
def self.configure_networks(machine, networks)
@@logger.debug("networks: #{networks.inspect}")
guest_network = ::VagrantWindows::Communication::GuestNetwork.new(machine.communicate.winrmshell)
-
- if (machine.provider_name != :vmware_fusion) && (machine.provider_name != :vmware_workstation)
+ unless VagrantWindows::Helper.is_vmware(machine)
vm_interface_map = create_vm_interface_map(machine, guest_network)
end
networks.each do |network|
interface = vm_interface_map[network[:interface]+1]
@@ -51,10 +51,10 @@
guest_network.network_adapters().each do |nic|
@@logger.debug("nic: #{nic.inspect}")
naked_mac = nic[:mac_address].gsub(':','')
if driver_mac_address[naked_mac]
vm_interface_map[driver_mac_address[naked_mac]] = {
- :name => nic[:net_connection_id],
+ :net_connection_id => nic[:net_connection_id],
:mac_address => naked_mac,
:interface_index => nic[:interface_index],
:index => nic[:index] }
end
end