Sha256: 5845e3760e33d41256f73a3981d67df4fd90569a51cec44f8e266978898f907d
Contents?: true
Size: 733 Bytes
Versions: 232
Compression:
Stored size: 733 Bytes
Contents
# Methods to help with handling warnings. module Puppet::Util::Warnings module_function def notice_once(msg) Puppet::Util::Warnings.maybe_log(msg, self.class) { Puppet.notice msg } end def debug_once(msg) return nil unless Puppet[:debug] Puppet::Util::Warnings.maybe_log(msg, self.class) { Puppet.debug msg } end def warnonce(msg) Puppet::Util::Warnings.maybe_log(msg, self.class) { Puppet.warning msg } end def clear_warnings @stampwarnings = {} nil end protected def self.maybe_log(message, klass) @stampwarnings ||= {} @stampwarnings[klass] ||= [] return nil if @stampwarnings[klass].include? message yield @stampwarnings[klass] << message nil end end
Version data entries
232 entries across 232 versions & 3 rubygems