Module: Puppet::Util::Warnings Private

Included in:
Indirector::Request, Provider, Provider, Resource::Type, Resource::TypeCollection, Type, Feature, SUIDManager
Defined in:
lib/puppet/util/warnings.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Methods to help with handling warnings.

Class Method Summary collapse

Class Method Details

.clear_warningsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


18
19
20
21
# File 'lib/puppet/util/warnings.rb', line 18

def clear_warnings
  @stampwarnings = {}
  nil
end

.debug_once(msg) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


9
10
11
12
# File 'lib/puppet/util/warnings.rb', line 9

def debug_once(msg)
  return nil unless Puppet[:debug]
  Puppet::Util::Warnings.maybe_log(msg, self.class) { Puppet.debug msg }
end

.maybe_log(message, klass) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


23
24
25
26
27
28
29
30
# File 'lib/puppet/util/warnings.rb', line 23

def self.maybe_log(message, klass)
  @stampwarnings ||= {}
  @stampwarnings[klass] ||= []
  return nil if @stampwarnings[klass].include? message
  yield
  @stampwarnings[klass] << message
  nil
end

.notice_once(msg) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


5
6
7
# File 'lib/puppet/util/warnings.rb', line 5

def notice_once(msg)
  Puppet::Util::Warnings.maybe_log(msg, self.class) { Puppet.notice msg }
end

.warnonce(msg) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


14
15
16
# File 'lib/puppet/util/warnings.rb', line 14

def warnonce(msg)
  Puppet::Util::Warnings.maybe_log(msg, self.class) { Puppet.warning msg }
end