2012-08-14 02:30:41 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module ProviderVirtualBox
|
|
|
|
module Action
|
2010-07-07 04:22:55 +00:00
|
|
|
class Suspend
|
|
|
|
def initialize(app, env)
|
|
|
|
@app = app
|
|
|
|
end
|
|
|
|
|
|
|
|
def call(env)
|
2012-08-14 02:30:41 +00:00
|
|
|
if env[:machine].provider.state == :running
|
2011-12-10 22:15:18 +00:00
|
|
|
env[:ui].info I18n.t("vagrant.actions.vm.suspend.suspending")
|
2012-08-14 02:30:41 +00:00
|
|
|
env[:machine].provider.driver.suspend
|
2010-07-07 04:22:55 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
@app.call(env)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|