Class: VagrantPlugins::Skytap::Action::InitialState

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-skytap/action/initial_state.rb

Overview

Our modified “up” command captures the VM states in the initial_states hash before running them, potentially in parallel.

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ InitialState

Returns a new instance of InitialState.


7
8
9
10
# File 'lib/vagrant-skytap/action/initial_state.rb', line 7

def initialize(app, env)
  @app = app
  @logger = Log4r::Logger.new("vagrant_skytap::action::initial_state")
end

Instance Method Details

#call(env) ⇒ Object


12
13
14
15
16
# File 'lib/vagrant-skytap/action/initial_state.rb', line 12

def call(env)
  # if initial_states is absent, result is nil
  env[:result] = env[:initial_states].try(:[], env[:machine].id)
  @app.call(env)
end