Sha256: a990167e5643c0d42d21eaf863e81d528cd96c193798c4a881c5685b5ff389e2

Contents?: true

Size: 632 Bytes

Versions: 4

Compression:

Stored size: 632 Bytes

Contents

require "log4r"

module VagrantPlugins
  module Shell
    module Action
      # This terminates the running instance.
      class TerminateInstance
        def initialize(app, env)
          @app    = app
          @logger = Log4r::Logger.new("vagrant_shell::action::terminate_instance")
        end

        def call(env)
          # Destroy the server and remove the tracking ID
          env[:ui].info(I18n.t("vagrant_shell.terminating"))
          `#{env[:machine].provider_config.script} terminate-instance #{env[:machine].id}`
          env[:machine].id = nil

          @app.call(env)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vagrant-shell-0.2.6 lib/vagrant-shell/action/terminate_instance.rb
vagrant-shell-0.2.5 lib/vagrant-shell/action/terminate_instance.rb
vagrant-shell-0.2.4 lib/vagrant-shell/action/terminate_instance.rb
vagrant-shell-0.2.3 lib/vagrant-shell/action/terminate_instance.rb