Sha256: 800312ae998818509d2d6271719087a842f21adc6f5622d9353b4e253380b262
Contents?: true
Size: 764 Bytes
Versions: 4
Compression:
Stored size: 764 Bytes
Contents
require "log4r" module VagrantPlugins module Cloudstack module Action # This stops the running instance. class StopInstance def initialize(app, env) @app = app @logger = Log4r::Logger.new("vagrant_cloudstack::action::stop_instance") end def call(env) server = env[:cloudstack_compute].servers.get(env[:machine].id) if env[:machine].state.id == :stopped env[:ui].info(I18n.t("vagrant_cloudstack.already_status", :status => env[:machine].state.id)) else env[:ui].info(I18n.t("vagrant_cloudstack.stopping")) server.stop({'force' => !!env[:force_halt]}) end @app.call(env) end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems