lib/vagrant/action/vm/network.rb in vagrantup-0.9.99.1 vs lib/vagrant/action/vm/network.rb in vagrantup-0.9.99.2
- old
+ new
@@ -35,16 +35,13 @@
# Get the virtualbox adapter configuration
adapter = send("#{type}_adapter", config)
adapters << adapter
# Get the network configuration
- if config[:auto_config]
- network = send("#{type}_network_config", config)
- networks << network
- else
- @logger.info("Auto config disabled, not configuring: #{type}")
- end
+ network = send("#{type}_network_config", config)
+ network[:_auto_config] = true if config[:auto_config]
+ networks << network
end
if !adapters.empty?
# Automatically assign an adapter number to any adapters
# that aren't explicitly set.
@@ -66,13 +63,15 @@
if !adapters.empty? && !networks.empty?
# Determine the interface numbers for the guest.
assign_interface_numbers(networks, adapters)
- # Configure all the network interfaces on the guest.
+ # Configure all the network interfaces on the guest. We only
+ # want to configure the networks that have `auto_config` setup.
+ networks_to_configure = networks.select { |n| n[:_auto_config] }
env[:ui].info I18n.t("vagrant.actions.vm.network.configuring")
- env[:vm].guest.configure_networks(networks)
+ env[:vm].guest.configure_networks(networks_to_configure)
end
end
# This method assigns the adapter to use for the adapter.
# e.g. it says that the first adapter is actually on the
@@ -251,11 +250,12 @@
return {
:adapter => config[:adapter],
:type => :hostonly,
:hostonly => interface[:name],
- :mac_address => config[:mac]
+ :mac_address => config[:mac],
+ :nic_type => config[:nic_type]
}
end
def hostonly_network_config(config)
return {
@@ -307,9 +307,10 @@
end
end
def bridged_config(args)
options = args[0] || {}
+ options = {} if !options.is_a?(Hash)
return {
:adapter => nil,
:mac => nil,
:bridge => nil,