Run "up" in a batch action so it parallelizes

This commit is contained in:
Mitchell Hashimoto 2013-03-21 19:22:54 -07:00
parent 3d8271a3a2
commit 54f7930b84
1 changed files with 14 additions and 6 deletions

View File

@ -29,14 +29,22 @@ module VagrantPlugins
# Go over each VM and bring it up
@logger.debug("'Up' each target VM...")
with_target_vms(argv, :provider => options[:provider]) do |machine|
@env.ui.info(I18n.t(
"vagrant.commands.up.upping",
:name => machine.name,
:provider => machine.provider_name))
machine.action(:up, options)
# Build up the batch job of what we'll do
batch = Vagrant::BatchAction.new.tap do |inner_batch|
with_target_vms(argv, :provider => options[:provider]) do |machine|
@env.ui.info(I18n.t(
"vagrant.commands.up.upping",
:name => machine.name,
:provider => machine.provider_name))
inner_batch.action(machine, :up, options)
end
end
# Run it!
batch.run
# Success, exit status 0
0
end