Class: Puppet::Network::Client::Report

Inherits:
Puppet::Network::Client show all
Defined in:
lib/puppet/network/client/report.rb

Constant Summary

Constants inherited from Puppet::Network::Client

Client

Instance Attribute Summary

Attributes inherited from Puppet::Network::Client

#driver, #lastrun, #local, #schedule, #stopping

Attributes included from Util::SubclassLoader

#classloader, #loader

Attributes included from SSLCertificates::Support

#cacert

Instance Method Summary collapse

Methods inherited from Puppet::Network::Client

drivername, handler, #local?, #recycle_connection, #run, #runnow, #scheduled?, #shutdown, #start, xmlrpc_client

Methods included from Util::SubclassLoader

#each, #handle_subclasses, #inherited, #method_missing, #name, #subclasses

Methods included from SSLCertificates::Support

keytype, #rename_files_with_uppercase, #requestcert

Methods included from Util::MethodHelper

#requiredopts, #set_options, #symbolize_options

Methods included from Util

activerecord_version, benchmark, chuser, classproxy, #execfail, #execpipe, execute, logmethods, memory, proxy, recmkdir, secure_open, symbolize, symbolizehash, symbolizehash!, synchronize_on, thinmark, #threadlock, which, withumask

Methods included from Util::POSIX

#get_posix_field, #gid, #idfield, #methodbyid, #methodbyname, #search_posix_field, #uid

Constructor Details

#initialize(hash = {}) ⇒ Report

Returns a new instance of Report.



4
5
6
7
8
# File 'lib/puppet/network/client/report.rb', line 4

def initialize(hash = {})
  hash[:Report] = self.class.handler.new if hash.include?(:Report)

  super(hash)
end

Instance Method Details

#report(transreport) ⇒ Object

Send our report. We get the transaction report and convert it to YAML as appropriate.



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/puppet/network/client/report.rb', line 12

def report(transreport)
  report = YAML.dump(transreport)

  report = CGI.escape(report) unless self.local

  # Now send the report
  file = nil
  benchmark(:info, "Sent transaction report") do
    file = @driver.report(report)
  end

  file
end