Sha256: 845815f9f62a13ea2e07aa7c2c14db381c707940d9ffb4f3cde4ab4a51720102

Contents?: true

Size: 1.31 KB

Versions: 143

Compression:

Stored size: 1.31 KB

Contents

Puppet::Face.define(:module, '1.0.0') do
  action(:changes) do
    summary "Show modified files of an installed module."
    description <<-EOT
      Shows any files in a module that have been modified since it was
      installed. This action compares the files on disk to the md5 checksums
      included in the module's checksums.json or, if that is missing, in
      metadata.json.
    EOT

    returns "Array of strings representing paths of modified files."

    examples <<-EOT
      Show modified files of an installed module:

      $ puppet module changes /etc/puppetlabs/code/modules/vcsrepo/
      warning: 1 files modified
      lib/puppet/provider/vcsrepo.rb
    EOT

    arguments "<path>"

    when_invoked do |path, options|
      Puppet::ModuleTool.set_option_defaults options
      unless root_path = Puppet::ModuleTool.find_module_root(path)
        raise ArgumentError, "Could not find a valid module at #{path.inspect}"
      end
      Puppet::ModuleTool::Applications::Checksummer.run(root_path, options)
    end

    when_rendering :console do |return_value|
      if return_value.empty?
        Puppet.notice "No modified files"
      else
        Puppet.warning "#{return_value.size} files modified"
      end
      return_value.map do |changed_file|
        "#{changed_file}"
      end.join("\n")
    end
  end
end

Version data entries

143 entries across 143 versions & 2 rubygems

Version Path
puppet-retrospec-1.8.0 vendor/pup410/lib/puppet/face/module/changes.rb
puppet-retrospec-1.7.0 vendor/pup410/lib/puppet/face/module/changes.rb
puppet-4.10.12 lib/puppet/face/module/changes.rb
puppet-4.10.12-x86-mingw32 lib/puppet/face/module/changes.rb
puppet-4.10.12-x64-mingw32 lib/puppet/face/module/changes.rb
puppet-4.10.12-universal-darwin lib/puppet/face/module/changes.rb
puppet-4.10.11 lib/puppet/face/module/changes.rb
puppet-4.10.11-x86-mingw32 lib/puppet/face/module/changes.rb
puppet-4.10.11-x64-mingw32 lib/puppet/face/module/changes.rb
puppet-4.10.11-universal-darwin lib/puppet/face/module/changes.rb
puppet-4.10.10 lib/puppet/face/module/changes.rb
puppet-4.10.10-x86-mingw32 lib/puppet/face/module/changes.rb
puppet-4.10.10-x64-mingw32 lib/puppet/face/module/changes.rb
puppet-4.10.10-universal-darwin lib/puppet/face/module/changes.rb
puppet-retrospec-1.6.1 vendor/pup410/lib/puppet/face/module/changes.rb
puppet-retrospec-1.6.0 vendor/pup410/lib/puppet/face/module/changes.rb
puppet-4.10.9 lib/puppet/face/module/changes.rb
puppet-4.10.9-x86-mingw32 lib/puppet/face/module/changes.rb
puppet-4.10.9-x64-mingw32 lib/puppet/face/module/changes.rb
puppet-4.10.9-universal-darwin lib/puppet/face/module/changes.rb