lib/vagrant-rimu/actions/terminate_instance.rb in vagrant-rimu-0.0.2 vs lib/vagrant-rimu/actions/terminate_instance.rb in vagrant-rimu-0.0.3
- old
+ new
@@ -1,17 +1,19 @@
require 'log4r'
+require 'vagrant-rimu/actions/abstract_action'
+
module VagrantPlugins
module Rimu
module Actions
# This terminates the running server, if there is one.
- class TerminateInstance
+ class TerminateInstance < AbstractAction
def initialize(app, _env)
@app = app
@logger = Log4r::Logger.new("vagrant_rimu::action::terminate_instance")
end
- def call(env)
+ def execute(env)
if env[:machine].id
env[:ui].info(I18n.t("vagrant_rimu.terminating"))
client = env[:rimu_api]
client.servers.cancel(env[:machine].id.to_i)
env[:machine].id = nil