Don't bother enabling/configuring network adapters if there are none
This commit is contained in:
parent
2d1ed88bcd
commit
b45286f780
|
@ -41,29 +41,33 @@ module Vagrant
|
||||||
networks << network
|
networks << network
|
||||||
end
|
end
|
||||||
|
|
||||||
# Automatically assign an adapter number to any adapters
|
if !adapters.empty?
|
||||||
# that aren't explicitly set.
|
# Automatically assign an adapter number to any adapters
|
||||||
@logger.debug("Assigning adapter locations...")
|
# that aren't explicitly set.
|
||||||
assign_adapter_locations(adapters)
|
@logger.debug("Assigning adapter locations...")
|
||||||
|
assign_adapter_locations(adapters)
|
||||||
|
|
||||||
# Verify that our adapters are good just prior to enabling them.
|
# Verify that our adapters are good just prior to enabling them.
|
||||||
verify_adapters(adapters)
|
verify_adapters(adapters)
|
||||||
|
|
||||||
# Create all the network interfaces
|
# Create all the network interfaces
|
||||||
@logger.info("Enabling adapters...")
|
@logger.info("Enabling adapters...")
|
||||||
env[:ui].info I18n.t("vagrant.actions.vm.network.preparing")
|
env[:ui].info I18n.t("vagrant.actions.vm.network.preparing")
|
||||||
env[:vm].driver.enable_adapters(adapters)
|
env[:vm].driver.enable_adapters(adapters)
|
||||||
|
end
|
||||||
|
|
||||||
# Continue the middleware chain. We're done with our VM
|
# Continue the middleware chain. We're done with our VM
|
||||||
# setup until after it is booted.
|
# setup until after it is booted.
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
|
|
||||||
# Determine the interface numbers for the guest.
|
if !adapters.empty?
|
||||||
assign_interface_numbers(networks, adapters)
|
# 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.
|
||||||
env[:ui].info I18n.t("vagrant.actions.vm.network.configuring")
|
env[:ui].info I18n.t("vagrant.actions.vm.network.configuring")
|
||||||
env[:vm].guest.configure_networks(networks)
|
env[:vm].guest.configure_networks(networks)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# This method assigns the adapter to use for the adapter.
|
# This method assigns the adapter to use for the adapter.
|
||||||
|
|
Loading…
Reference in New Issue