diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2010-11-23 16:42:06 -0800 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2010-11-23 16:42:06 -0800 |
| commit | 4b35402ba85d8842d757becec5c8a7bf4d6f6654 (patch) | |
| tree | 5da174c4c1c106b99e8c464e45e89d7b5ba2b5a2 /lib/puppet/application | |
| parent | a7bd1630622cace01d0e4c974c76366e4b3b886c (diff) | |
| parent | 2bc6727b6ac7348dbac98099f1fe0aeb3cd1295f (diff) | |
| download | puppet-4b35402ba85d8842d757becec5c8a7bf4d6f6654.tar.gz puppet-4b35402ba85d8842d757becec5c8a7bf4d6f6654.tar.xz puppet-4b35402ba85d8842d757becec5c8a7bf4d6f6654.zip | |
Merge branch 'next'
Diffstat (limited to 'lib/puppet/application')
| -rw-r--r-- | lib/puppet/application/agent.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/application/apply.rb | 23 |
2 files changed, 7 insertions, 18 deletions
diff --git a/lib/puppet/application/agent.rb b/lib/puppet/application/agent.rb index 2b75505fd..c5ad72068 100644 --- a/lib/puppet/application/agent.rb +++ b/lib/puppet/application/agent.rb @@ -229,6 +229,8 @@ class Puppet::Application::Agent < Puppet::Application Puppet::SSL::Host.ca_location = options[:fingerprint] ? :none : :remote Puppet::Transaction::Report.terminus_class = :rest + # we want the last report to be persisted locally + Puppet::Transaction::Report.cache_class = :yaml # Override the default; puppetd needs this, usually. # You can still override this on the command-line with, e.g., :compiler. diff --git a/lib/puppet/application/apply.rb b/lib/puppet/application/apply.rb index 59a95d35a..8ec3fab6b 100644 --- a/lib/puppet/application/apply.rb +++ b/lib/puppet/application/apply.rb @@ -123,25 +123,9 @@ class Puppet::Application::Apply < Puppet::Application require 'puppet/configurer' configurer = Puppet::Configurer.new - configurer.execute_prerun_command + report = configurer.run(:skip_plugin_download => true, :catalog => catalog) - # And apply it - if Puppet[:report] - report = configurer.initialize_report - Puppet::Util::Log.newdestination(report) - end - transaction = catalog.apply - - configurer.execute_postrun_command - - if Puppet[:report] - Puppet::Util::Log.close(report) - configurer.send_report(report, transaction) - else - transaction.generate_report - end - - exit( Puppet[:noop] ? 0 : options[:detailed_exitcodes] ? transaction.report.exit_status : 0 ) + exit( Puppet[:noop] ? 0 : options[:detailed_exitcodes] ? report.exit_status : 0 ) rescue => detail puts detail.backtrace if Puppet[:trace] $stderr.puts detail.message @@ -164,6 +148,9 @@ class Puppet::Application::Apply < Puppet::Application exit(1) end + # we want the last report to be persisted locally + Puppet::Transaction::Report.cache_class = :yaml + if options[:debug] Puppet::Util::Log.level = :debug elsif options[:verbose] |
