Class: R10K::Task::Puppetfile::Purge Deprecated

Inherits:
Base
  • Object
show all
Defined in:
lib/r10k/task/puppetfile.rb

Overview

Deprecated.

Constant Summary

Constants included from Logging

Logging::LOG_LEVELS

Instance Attribute Summary

Attributes inherited from Base

#task_runner

Instance Method Summary collapse

Methods included from Logging

formatter, included, level, level=, levels, #logger, #logger_name, outputter, parse_level

Constructor Details

#initialize(puppetfile) ⇒ Purge

Returns a new instance of Purge.



80
81
82
# File 'lib/r10k/task/puppetfile.rb', line 80

def initialize(puppetfile)
  @puppetfile = puppetfile
end

Instance Method Details

#callObject



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/r10k/task/puppetfile.rb', line 84

def call
  moduledir = @puppetfile.moduledir

  @puppetfile.load

  stale_mods = @puppetfile.stale_contents

  if stale_mods.empty?
    logger.debug "No stale modules in #{moduledir}"
  else
    logger.info "Purging stale modules from #{moduledir}"
    logger.debug "Stale modules in #{moduledir}: #{stale_mods.join(', ')}"
    @puppetfile.purge!
  end
end