?
Current Path : /usr/share/ruby/vendor_ruby/puppet/util/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : //usr/share/ruby/vendor_ruby/puppet/util/warnings.rb |
# 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) 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