Mitchell Hashimoto 5eed3b8417 Building up the destroy action again using new provider API.
This shows me moving the built-in middleware sequences to the provider
and how I'm organizing all that.
2012-07-26 22:39:27 -07:00

24 lines
639 B
Ruby

module VagrantPlugins
module ProviderVirtualBox
module Action
class CheckAccessible
def initialize(app, env)
@app = app
end
def call(env)
if env[:machine].state == :inaccessible
# The VM we are attempting to manipulate is inaccessible. This
# is a very bad situation and can only be fixed by the user. It
# also prohibits us from actually doing anything with the virtual
# machine, so we raise an error.
raise Vagrant::Errors::VMInaccessible
end
@app.call(env)
end
end
end
end
end