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] [vm]
end end
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 end
end end

View File

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

View File

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