Class: VagrantPlugins::ProviderVeertu::Action::CheckCreated
- Inherits:
-
Object
- Object
- VagrantPlugins::ProviderVeertu::Action::CheckCreated
- Defined in:
- lib/vagrant-veertu/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.
7 8 9 |
# File 'lib/vagrant-veertu/action/check_created.rb', line 7 def initialize(app, env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/vagrant-veertu/action/check_created.rb', line 11 def call(env) if env[:machine].state.id == :not_created raise Vagrant::Errors::VMNotCreatedError end @app.call(env) end |