class VagrantPlugins::DockerProvider::Action::CheckRunning
Public Class Methods
new(app, env)
click to toggle source
# File lib/docker-provider/action/check_running.rb, line 5 def initialize(app, env) @app = app end
Public Instance Methods
call(env)
click to toggle source
# File lib/docker-provider/action/check_running.rb, line 9 def call(env) if env[:machine].state.id == :not_created raise Vagrant::Errors::VMNotCreatedError end if env[:machine].state.id == :stopped raise Vagrant::Errors::VMNotRunningError end # Call the next if we have one (but we shouldn't, since this # middleware is built to run with the Call-type middlewares) @app.call(env) end