Get regression working again

This commit is contained in:
Mitchell Hashimoto 2011-12-10 16:38:01 -08:00
parent baba6af4ff
commit d05c6f9d61
3 changed files with 15 additions and 5 deletions

View File

@ -28,6 +28,16 @@ module Vagrant
[vm]
end
end
# This will yield for each target VM to the command. The VM is guaranteed
# to be loaded on each iteration.
def with_target_vms
target_vms.each do |old_vm|
# We get a new VM here to avoid potentially stale VMs
vm = env.vms[old_vm.name]
yield vm
end
end
end
end
end

View File

@ -5,7 +5,7 @@ module Vagrant
register "up", "Creates the Vagrant environment"
def execute
target_vms.each do |vm|
with_target_vms do |vm|
if vm.created?
vm.env.ui.info I18n.t("vagrant.commands.up.vm_created")
vm.start("provision.enabled" => options[:provision])

View File

@ -357,11 +357,11 @@ module Vagrant
# Reloads the configuration of this environment.
def reload!
@config = nil
@vms = nil
# Reload the configuration
load_config!
load_vms!
self
# Clear the VMs because this can now be diferent due to configuration
@vms = nil
end
# Loads this environment's configuration and stores it in the {#config}