2012-07-27 05:39:27 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module ProviderVirtualBox
|
|
|
|
module Action
|
2011-08-29 03:32:22 +00:00
|
|
|
class CheckAccessible
|
|
|
|
def initialize(app, env)
|
|
|
|
@app = app
|
|
|
|
end
|
|
|
|
|
|
|
|
def call(env)
|
2012-07-27 05:39:27 +00:00
|
|
|
if env[:machine].state == :inaccessible
|
2011-08-29 03:32:22 +00:00
|
|
|
# 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.
|
2012-07-27 05:39:27 +00:00
|
|
|
raise Vagrant::Errors::VMInaccessible
|
2011-08-29 03:32:22 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
@app.call(env)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|