Class: VagrantPlugins::Skytap::Action::CheckCreated
- Defined in:
- lib/vagrant-skytap/action/check_created.rb
Overview
This middleware checks that the VM is created, and raises an exception if it is not, notifying the user that creation is required.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ CheckCreated
constructor
A new instance of CheckCreated.
Constructor Details
#initialize(app, env) ⇒ CheckCreated
Returns a new instance of CheckCreated.
29 30 31 |
# File 'lib/vagrant-skytap/action/check_created.rb', line 29 def initialize(app, env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/vagrant-skytap/action/check_created.rb', line 33 def call(env) if env[:machine].state.id == :not_created raise Vagrant::Errors::VMNotCreatedError end @app.call(env) end |