Sha256: 512b800c68f8f39f49533751f80fdf3995c134bc37af44c8e011e7fdcf556e0f

Contents?: true

Size: 581 Bytes

Versions: 5

Compression:

Stored size: 581 Bytes

Contents

require 'log4r'

module VagrantPlugins
  module OVirtProvider
    module Action
      class DestroyVM
        def initialize(app, env)
          @logger = Log4r::Logger.new("vagrant_ovirt4::action::destroy_vm")
          @app = app
        end

        def call(env)
          # Destroy the server, remove the tracking ID
          env[:ui].info(I18n.t("vagrant_ovirt4.destroy_vm"))

          vm_service = env[:vms_service].vm_service(env[:machine].id)
          vm_service.remove
          env[:machine].id = nil

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vagrant-ovirt4-1.2.0 lib/vagrant-ovirt4/action/destroy_vm.rb
vagrant-ovirt4-1.1.0 lib/vagrant-ovirt4/action/destroy_vm.rb
vagrant-ovirt4-1.0.2 lib/vagrant-ovirt4/action/destroy_vm.rb
vagrant-ovirt4-1.0.1 lib/vagrant-ovirt4/action/destroy_vm.rb
vagrant-ovirt4-1.0.0 lib/vagrant-ovirt4/action/destroy_vm.rb