Sha256: cc676bb7a3a31f678ca080ae79332c1ce18c6b11c2c6dbe7c704e5d1bfd2dc9f

Contents?: true

Size: 892 Bytes

Versions: 6

Compression:

Stored size: 892 Bytes

Contents

require "log4r"

require_relative "mixin_provisioners"

module Vagrant
  module Action
    module Builtin
      # This action will run the cleanup methods on provisioners and should
      # be used as part of any Destroy action.
      class ProvisionerCleanup
        include MixinProvisioners

        def initialize(app, env)
          @app    = app
          @logger = Log4r::Logger.new("vagrant::action::builtin::provision_cleanup")
        end

        def call(env)
          @env = env

          # Ask the provisioners to modify the configuration if needed
          provisioner_instances.each do |p|
            env[:ui].info(I18n.t(
              "vagrant.provisioner_cleanup",
              name: provisioner_type_map[p].to_s))
            p.cleanup
          end

          # Continue, we need the VM to be booted.
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
tamtam-vagrant-reload-1.1.3 vendor/cache/vagrant-0ac2a8738841/lib/vagrant/action/builtin/provisioner_cleanup.rb
tamtam-vagrant-reload-1.1.2 vendor/cache/vagrant-0ac2a8738841/lib/vagrant/action/builtin/provisioner_cleanup.rb
tamtam-vagrant-reload-1.1.1 vendor/cache/vagrant-0ac2a8738841/lib/vagrant/action/builtin/provisioner_cleanup.rb
tamtam-vagrant-reload-1.1 vendor/cache/vagrant-0ac2a8738841/lib/vagrant/action/builtin/provisioner_cleanup.rb
tnargav-1.3.6 lib/vagrant/action/builtin/provisioner_cleanup.rb
tnargav-1.3.3 lib/vagrant/action/builtin/provisioner_cleanup.rb