summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2010-08-21 14:35:05 -0700
committerMarkus Roberts <Markus@reality.com>2010-08-24 18:08:06 -0700
commit302d657658db068c0c593545e92923659608c5a3 (patch)
treefb50b52712582d4aad444e10e2c0e76e72cc9cf4 /lib
parent1ea4ccf44bc45ff7ccccc54720391bbe81c8a8fb (diff)
downloadpuppet-302d657658db068c0c593545e92923659608c5a3.tar.gz
puppet-302d657658db068c0c593545e92923659608c5a3.tar.xz
puppet-302d657658db068c0c593545e92923659608c5a3.zip
Fix for #4501 -- reports not generated in standalone
The refactors for 2.6.x stopped "puppet apply" from saving reports; this fix adds report saving back to puppet apply but leaves a number of related issues (code path consolidation, report contents, etc.) unresolved for future patches in the 2.6.x series or more significant refactoring in 2.7.x.
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/application/apply.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/puppet/application/apply.rb b/lib/puppet/application/apply.rb
index 152b75442..59a95d35a 100644
--- a/lib/puppet/application/apply.rb
+++ b/lib/puppet/application/apply.rb
@@ -126,17 +126,22 @@ class Puppet::Application::Apply < Puppet::Application
configurer.execute_prerun_command
# And apply it
+ if Puppet[:report]
+ report = configurer.initialize_report
+ Puppet::Util::Log.newdestination(report)
+ end
transaction = catalog.apply
configurer.execute_postrun_command
- status = 0
- if not Puppet[:noop] and options[:detailed_exitcodes]
- transaction.generate_report
- exit(transaction.report.exit_status)
+ if Puppet[:report]
+ Puppet::Util::Log.close(report)
+ configurer.send_report(report, transaction)
else
- exit(0)
+ transaction.generate_report
end
+
+ exit( Puppet[:noop] ? 0 : options[:detailed_exitcodes] ? transaction.report.exit_status : 0 )
rescue => detail
puts detail.backtrace if Puppet[:trace]
$stderr.puts detail.message