Sha256: be1ac99c6ee226173e3a69c88b65737827fb58748b8f232d45aa222982fdb986

Contents?: true

Size: 633 Bytes

Versions: 3

Compression:

Stored size: 633 Bytes

Contents

module VagrantPlugins
  module BetterHosts
    module Action
      class RemoveHosts < BaseAction

        def run(env)
          machine_action = env[:machine_action]

          return unless @machine.id
          return unless %i[destroy halt suspend].include? machine_action

          if (%i[halt suspend].include? machine_action) && (false == @machine.config.goodhosts.remove_on_suspend)
            @ui.info '[vagrant-betterhosts] Removing hosts on suspend disabled'
          else
            @ui.info '[vagrant-betterhosts] Removing hosts'
            removeHostEntries
          end
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-betterhosts-0.2.1 lib/vagrant-betterhosts/Action/RemoveHosts.rb
vagrant-betterhosts-0.2.0 lib/vagrant-betterhosts/Action/RemoveHosts.rb
vagrant-betterhosts-0.1.0 lib/vagrant-betterhosts/Action/RemoveHosts.rb