Sha256: 41d32e3c9ded9146ea540db8affdeb5e5621320ed58eef59054042d926bea4ed

Contents?: true

Size: 627 Bytes

Versions: 10

Compression:

Stored size: 627 Bytes

Contents

# Run when is removing the hosts
module VagrantPlugins
  module GoodHosts
    module Action
      # Remove hosts
      class RemoveHosts < BaseAction
        def run(env)
          machine_action = env[:machine_action]

          return unless @machine.id
          return unless [:destroy, :halt, :suspend].include? machine_action

          if ([:halt, :suspend].include? machine_action) && (false == @machine.config.goodhosts.remove_on_suspend)
            @ui.info "[vagrant-goodhosts] Removing hosts on suspend disabled"
          else
            remove_host_entries
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
vagrant-goodhosts-1.1.7 lib/vagrant-goodhosts/Action/RemoveHosts.rb
vagrant-goodhosts-1.1.6 lib/vagrant-goodhosts/Action/RemoveHosts.rb
vagrant-goodhosts-1.1.5 lib/vagrant-goodhosts/Action/RemoveHosts.rb
vagrant-goodhosts-1.1.4 lib/vagrant-goodhosts/Action/RemoveHosts.rb
vagrant-goodhosts-1.1.3 lib/vagrant-goodhosts/Action/RemoveHosts.rb
vagrant-goodhosts-1.1.2 lib/vagrant-goodhosts/Action/RemoveHosts.rb
vagrant-goodhosts-1.1.1 lib/vagrant-goodhosts/Action/RemoveHosts.rb
vagrant-goodhosts-1.1.0 lib/vagrant-goodhosts/Action/RemoveHosts.rb
vagrant-goodhosts-1.1.0beta2 lib/vagrant-goodhosts/Action/RemoveHosts.rb
vagrant-goodhosts-1.1.0beta lib/vagrant-goodhosts/Action/RemoveHosts.rb