Sha256: ecd93cf1d26f5a59d3aff13d7b7f22eb5aa1922a844f8bd2bab0a797132f1308
Contents?: true
Size: 895 Bytes
Versions: 2
Compression:
Stored size: 895 Bytes
Contents
require "log4r" module VagrantPlugins module Skytap module Action # Runs multiple VMs in parallel. Ensures that the REST call happens # only once. class RunEnvironment attr_reader :env def initialize(app, env) @app = app @env = env @logger = Log4r::Logger.new("vagrant_skytap::action::run_environment") end def call(env) environment = env[:environment] vm_ids = vm_ids_to_run if environment.current_vm.id == vm_ids.first env[:ui].info(I18n.t("vagrant_skytap.running_environment")) @logger.info("Running VMs: #{vm_ids}") environment.run!(vm_ids) end @app.call(env) end def vm_ids_to_run @env[:initial_states].reject{|id, state| state == :running}.keys end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
vagrant-skytap-0.2.3 | lib/vagrant-skytap/action/run_environment.rb |
vagrant-skytap-0.2.2 | lib/vagrant-skytap/action/run_environment.rb |