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