Fix edge case which caused exception in network configuration code.

[GH-742]
This commit is contained in:
Mitchell Hashimoto 2012-02-15 11:11:11 -08:00
parent 034477b52a
commit 163da82170
2 changed files with 8 additions and 8 deletions

View File

@ -21,6 +21,7 @@
occurred. [GH-725]
- `vagrant destroy` destroys virtual machines in reverse order. [GH-739]
- Add an `fsid` option to Linux NFS exports. [GH-736]
- Fix edge case where an exception could be raised in networking code. [GH-742]
## 0.9.7 (February 9, 2012)

View File

@ -37,12 +37,9 @@ module Vagrant
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?
@ -68,9 +65,11 @@ module Vagrant
# 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