Class: Puppet::Network::Handler::Report
- Defined in:
- lib/puppet/network/handler/report.rb
Class Method Summary collapse
-
.newreport(name, options = {}, &block) ⇒ Object
Add a new report type.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Report
constructor
A new instance of Report.
-
#report(report, client = nil, clientip = nil) ⇒ Object
Accept a report from a client.
Constructor Details
Class Method Details
.newreport(name, options = {}, &block) ⇒ Object
Add a new report type.
14 15 16 17 |
# File 'lib/puppet/network/handler/report.rb', line 14 def self.newreport(name, = {}, &block) Puppet.warning "The interface for registering report types has changed; use Puppet::Reports.register_report for report type #{name}" Puppet::Reports.register_report(name, , &block) end |
Instance Method Details
#report(report, client = nil, clientip = nil) ⇒ Object
Accept a report from a client.
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/puppet/network/handler/report.rb', line 25 def report(report, client = nil, clientip = nil) # Unescape the report report = CGI.unescape(report) unless @local Puppet.info "Processing reports #{reports().join(", ")} for #{client}" begin process(report) rescue => detail Puppet.err "Could not process report for #{client}: #{detail}" puts detail.backtrace if Puppet[:trace] end end |