Sha256: 6f7c2521aa01ca1998fe8fa4f89d8e62f5b7af34f8e162f7f04b6ce9d46ef0b6
Contents?: true
Size: 712 Bytes
Versions: 15
Compression:
Stored size: 712 Bytes
Contents
require "log4r" module VagrantPlugins module Sakura module Action class Halt def initialize(app, env) @app = app @logger = Log4r::Logger.new("vagrant_sakura::action::halt") end def call(env) api = env[:sakura_api] serverid = env[:machine].id env[:ui].info(I18n.t("vagrant_sakura.power_off")) response = api.delete("/server/#{serverid}/power") sleep 3 while true response = api.get("/server/#{serverid}/power") break if response["Instance"]["Status"] == "down" sleep 1 end @app.call(env) end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems