Class: VagrantPlugins::Utm::Action::CheckCreated

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant_utm/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

Constructor Details

#initialize(app, _env) ⇒ CheckCreated

Returns a new instance of CheckCreated.



12
13
14
# File 'lib/vagrant_utm/action/check_created.rb', line 12

def initialize(app, _env)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object

Raises:

  • (Vagrant::Errors::VMNotCreatedError)


16
17
18
19
20
# File 'lib/vagrant_utm/action/check_created.rb', line 16

def call(env)
  raise Vagrant::Errors::VMNotCreatedError if env[:machine].state.id == :not_created

  @app.call(env)
end