summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/warnings.rb
blob: d009c39671dbf1aede74221be7a59b3556b842f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Methods to help with handling warnings.
module Puppet::Util::Warnings
    module_function

    def warnonce(msg)
        $stampwarnings ||= {}
        $stampwarnings[self.class] ||= []
        unless $stampwarnings[self.class].include? msg
            Puppet.warning msg
            $stampwarnings[self.class] << msg
        end
    end
end