Sha256: f9733accdb809ad604c9c9e7d4e027c30b900e4e80fb3e29df4c177cad12940f

Contents?: true

Size: 651 Bytes

Versions: 19

Compression:

Stored size: 651 Bytes

Contents

require "log4r"

module VagrantPlugins
  module OpenStack
    module Action
      # This deletes the running server, if there is one.
      class DeleteServer
        def initialize(app, env)
          @app    = app
          @logger = Log4r::Logger.new("vagrant_openstack::action::delete_server")
        end

        def call(env)
          if env[:machine].id
            env[:ui].info(I18n.t("vagrant_openstack.deleting_server"))
            server = env[:openstack_compute].servers.get(env[:machine].id)
            server.destroy
            env[:machine].id = nil
          end

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

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
vagrant-openstack-cloud-provider-1.1.13 lib/vagrant-openstack-cloud-provider/action/delete_server.rb
vagrant-openstack-cloud-provider-1.1.12 lib/vagrant-openstack-cloud-provider/action/delete_server.rb
vagrant-openstack-cloud-provider-1.1.11 lib/vagrant-openstack-cloud-provider/action/delete_server.rb
vagrant-openstack-cloud-provider-1.1.10 lib/vagrant-openstack-cloud-provider/action/delete_server.rb
vagrant-openstack-cloud-provider-1.1.9 lib/vagrant-openstack-cloud-provider/action/delete_server.rb
vagrant-openstack-cloud-provider-1.1.8 lib/vagrant-openstack-cloud-provider/action/delete_server.rb
vagrant-openstack-cloud-provider-1.1.6 lib/vagrant-openstack-cloud-provider/action/delete_server.rb
vagrant-openstack-cloud-provider-1.1.5 lib/vagrant-openstack-cloud-provider/action/delete_server.rb
vagrant-openstack-cloud-provider-1.1.4 lib/vagrant-openstack-cloud-provider/action/delete_server.rb
openstack-vagrant-1.1.3 lib/vagrant-openstack/action/delete_server.rb
openstack-vagrant-1.1.2 lib/vagrant-openstack/action/delete_server.rb
vagrant-openstack-plugin-0.4.1 lib/vagrant-openstack-plugin/action/delete_server.rb
vagrant-openstack-plugin-0.3.0 lib/vagrant-openstack-plugin/action/delete_server.rb
vagrant-openstack-plugin-0.2.2 lib/vagrant-openstack-plugin/action/delete_server.rb
vagrant-openstack-plugin-0.2.1 lib/vagrant-openstack-plugin/action/delete_server.rb
vagrant-openstack-plugin-0.2.0 lib/vagrant-openstack-plugin/action/delete_server.rb
vagrant-openstack-plugin-0.1.3 lib/vagrant-openstack-plugin/action/delete_server.rb
vagrant-openstack-plugin-0.1.2 lib/vagrant-openstack-plugin/action/delete_server.rb
vagrant-openstack-plugin-0.1.1 lib/vagrant-openstack/action/delete_server.rb