diff options
| author | Paul Berry <paul@puppetlabs.com> | 2010-11-23 11:47:36 -0800 |
|---|---|---|
| committer | Paul Berry <paul@puppetlabs.com> | 2010-11-23 13:30:08 -0800 |
| commit | 3a815e191837f9fc1fb7b6621be607225347f014 (patch) | |
| tree | 2e67ffb5c1141ef1a66e53d0bf09d5fa2ce54cee /lib/puppet/application | |
| parent | 3d2fbf604f997e6b9fd94edb96419ffa9869e709 (diff) | |
| download | puppet-3a815e191837f9fc1fb7b6621be607225347f014.tar.gz puppet-3a815e191837f9fc1fb7b6621be607225347f014.tar.xz puppet-3a815e191837f9fc1fb7b6621be607225347f014.zip | |
(#5375) Rework puppet apply to use configurer.run
Puppet apply used to contain code that duplicated the functionality of
configurer.run. Refactored to share code.
Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
Diffstat (limited to 'lib/puppet/application')
| -rw-r--r-- | lib/puppet/application/apply.rb | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/lib/puppet/application/apply.rb b/lib/puppet/application/apply.rb index 32a6b65b9..8ec3fab6b 100644 --- a/lib/puppet/application/apply.rb +++ b/lib/puppet/application/apply.rb @@ -123,26 +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(:report => report) - - configurer.execute_postrun_command - - if Puppet[:report] - Puppet::Util::Log.close(report) - configurer.send_report(report, transaction) - else - transaction.generate_report - configurer.save_last_run_summary(transaction.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 |
