Class: VagrantPlugins::OpenNebulaProvider::Action::WaitForState
- Inherits:
-
Object
- Object
- VagrantPlugins::OpenNebulaProvider::Action::WaitForState
- Defined in:
- lib/opennebula-provider/action/wait_for_state.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env, state) ⇒ WaitForState
constructor
A new instance of WaitForState.
Constructor Details
#initialize(app, env, state) ⇒ WaitForState
Returns a new instance of WaitForState.
5 6 7 8 9 |
# File 'lib/opennebula-provider/action/wait_for_state.rb', line 5 def initialize(app, env, state) @app = app @state = state @logger = Log4r::Logger.new('vagrant::provider::opennebula::wait_for_state') end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/opennebula-provider/action/wait_for_state.rb', line 11 def call(env) driver = env[:machine].provider.driver driver.wait_for_state(env, @state) do |last_state| # env[:machine_state] = last_state.to_sym break if last_state == :error end @app.call(env) end |