2014-03-26 23:45:46 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module DockerProvider
|
|
|
|
module Action
|
|
|
|
class Stop
|
|
|
|
def initialize(app, env)
|
|
|
|
@app = app
|
|
|
|
end
|
|
|
|
|
|
|
|
def call(env)
|
|
|
|
machine = env[:machine]
|
|
|
|
driver = machine.provider.driver
|
|
|
|
if driver.running?(machine.id)
|
|
|
|
env[:ui].info I18n.t("docker_provider.messages.stopping")
|
2014-10-22 00:50:45 +00:00
|
|
|
driver.stop(machine.id, machine.provider_config.stop_timeout)
|
2014-03-26 23:45:46 +00:00
|
|
|
end
|
|
|
|
@app.call(env)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|