diff options
Diffstat (limited to 'lib/puppet/client')
| -rw-r--r-- | lib/puppet/client/master.rb | 17 | ||||
| -rw-r--r-- | lib/puppet/client/reporter.rb | 14 |
2 files changed, 11 insertions, 20 deletions
diff --git a/lib/puppet/client/master.rb b/lib/puppet/client/master.rb index 6d57a310a..2544d3aef 100644 --- a/lib/puppet/client/master.rb +++ b/lib/puppet/client/master.rb @@ -76,12 +76,7 @@ class Puppet::Client::MasterClient < Puppet::Client raise Puppet::Error, "Cannot apply; objects not defined" end - # this is a gross hack... but i don't see a good way around it - # set all of the variables to empty - Puppet::Transaction.init - transaction = @objects.evaluate - transaction.toplevel = true if tags transaction.tags = tags @@ -104,16 +99,14 @@ class Puppet::Client::MasterClient < Puppet::Client ensure Puppet::Storage.store end - Puppet::Metric.gather - Puppet::Metric.tally - if Puppet[:rrdgraph] == true - Metric.store - Metric.graph - end if Puppet[:report] + report = transaction.report() + if Puppet[:rrdgraph] == true + report.graph() + end begin - reportclient().report(transaction) + reportclient().report(report) rescue => detail Puppet.err "Reporting failed: %s" % detail end diff --git a/lib/puppet/client/reporter.rb b/lib/puppet/client/reporter.rb index ff80f367d..b0101e2fa 100644 --- a/lib/puppet/client/reporter.rb +++ b/lib/puppet/client/reporter.rb @@ -13,24 +13,22 @@ class Puppet::Client::Reporter < Puppet::Client::ProxyClient super(hash) end - # Send our report. We get the transaction, and we convert it to a report + # Send our report. We get the transaction report and convert it to YAML # as appropriate. - def report(transaction) - # We receive an array of log events, and we need to convert them into - # a single big YAML file. - - array = transaction.report - - report = YAML.dump(array) + def report(transreport) + report = YAML.dump(transreport) unless self.local report = CGI.escape(report) end # Now send the report + file = nil benchmark(:info, "Sent transaction report") do file = @driver.report(report) end + + file end end |
