2013-03-11 03:08:28 +00:00
|
|
|
module Vagrant
|
|
|
|
module LXC
|
|
|
|
module Action
|
|
|
|
class ForcedHalt
|
|
|
|
def initialize(app, env)
|
|
|
|
@app = app
|
|
|
|
end
|
|
|
|
|
|
|
|
def call(env)
|
2013-04-08 23:07:06 +00:00
|
|
|
if env[:machine].provider.state.id == :running
|
2013-04-18 06:19:43 +00:00
|
|
|
env[:ui].info I18n.t("vagrant_lxc.messages.force_shutdown")
|
2013-05-07 14:07:35 +00:00
|
|
|
env[:machine].provider.driver.forced_halt
|
2013-03-11 03:08:28 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
@app.call(env)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|