2012-08-14 03:03:35 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module ProviderVirtualBox
|
|
|
|
module Action
|
2010-07-07 04:27:20 +00:00
|
|
|
class Resume
|
|
|
|
def initialize(app, env)
|
|
|
|
@app = app
|
|
|
|
end
|
|
|
|
|
|
|
|
def call(env)
|
2013-01-31 06:47:45 +00:00
|
|
|
current_state = env[:machine].provider.state.id
|
|
|
|
|
|
|
|
if current_state == :paused
|
|
|
|
env[:ui].info I18n.t("vagrant.actions.vm.resume.unpausing")
|
|
|
|
env[:machine].provider.driver.resume
|
|
|
|
elsif current_state == :saved
|
2011-12-10 22:18:40 +00:00
|
|
|
env[:ui].info I18n.t("vagrant.actions.vm.resume.resuming")
|
|
|
|
env[:action_runner].run(Boot, env)
|
2010-07-07 04:27:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
@app.call(env)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|