class Puppet::Util::Puppetdb::Blacklist
Constants
- BlacklistedEvent
- BlacklistedEvents
Initialize our blacklist of events to filter out of reports. This is needed because older versions of puppet always generate a swath of (meaningless) 'skipped' Schedule events on every agent run. As of puppet 3.3, these events should no longer be generated, but this is here for backward compat.
Private Class Methods
new(events)
click to toggle source
# File lib/puppet/util/puppetdb/blacklist.rb, line 18 def initialize(events) @events = events.inject({}) do |m, e| m[e.resource_type] ||= {} m[e.resource_type][e.resource_title] ||= {} m[e.resource_type][e.resource_title][e.status] ||= {} m[e.resource_type][e.resource_title][e.status][e.property] = true m end end
Private Instance Methods
is_event_blacklisted?(event)
click to toggle source
# File lib/puppet/util/puppetdb/blacklist.rb, line 28 def is_event_blacklisted?(event) @events.fetch(event["resource-type"], {}). fetch(event["resource-title"], {}). fetch(event["status"], {}). fetch(event["property"], false) end