Don't bother enabling/configuring network adapters if there are none
This commit is contained in:
parent
2d1ed88bcd
commit
b45286f780
|
@ -41,6 +41,7 @@ module Vagrant
|
|||
networks << network
|
||||
end
|
||||
|
||||
if !adapters.empty?
|
||||
# Automatically assign an adapter number to any adapters
|
||||
# that aren't explicitly set.
|
||||
@logger.debug("Assigning adapter locations...")
|
||||
|
@ -53,11 +54,13 @@ module Vagrant
|
|||
@logger.info("Enabling adapters...")
|
||||
env[:ui].info I18n.t("vagrant.actions.vm.network.preparing")
|
||||
env[:vm].driver.enable_adapters(adapters)
|
||||
end
|
||||
|
||||
# Continue the middleware chain. We're done with our VM
|
||||
# setup until after it is booted.
|
||||
@app.call(env)
|
||||
|
||||
if !adapters.empty?
|
||||
# Determine the interface numbers for the guest.
|
||||
assign_interface_numbers(networks, adapters)
|
||||
|
||||
|
@ -65,6 +68,7 @@ module Vagrant
|
|||
env[:ui].info I18n.t("vagrant.actions.vm.network.configuring")
|
||||
env[:vm].guest.configure_networks(networks)
|
||||
end
|
||||
end
|
||||
|
||||
# This method assigns the adapter to use for the adapter.
|
||||
# e.g. it says that the first adapter is actually on the
|
||||
|
|
Loading…
Reference in New Issue