diff options
author | Paul Berry <paul@puppetlabs.com> | 2010-11-23 13:32:03 -0800 |
---|---|---|
committer | Paul Berry <paul@puppetlabs.com> | 2010-11-23 13:32:03 -0800 |
commit | 2bc6727b6ac7348dbac98099f1fe0aeb3cd1295f (patch) | |
tree | 5da174c4c1c106b99e8c464e45e89d7b5ba2b5a2 /lib/puppet | |
parent | 78beb7062caa65cd230e92012a29812b4c4af5ed (diff) | |
parent | 3a815e191837f9fc1fb7b6621be607225347f014 (diff) | |
download | puppet-2bc6727b6ac7348dbac98099f1fe0aeb3cd1295f.tar.gz puppet-2bc6727b6ac7348dbac98099f1fe0aeb3cd1295f.tar.xz puppet-2bc6727b6ac7348dbac98099f1fe0aeb3cd1295f.zip |
Merge branch 'ticket/next/5375' into next
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/application/apply.rb | 21 | ||||
-rw-r--r-- | lib/puppet/configurer.rb | 8 |
2 files changed, 6 insertions, 23 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 diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb index e46e9a6e7..1c0639029 100644 --- a/lib/puppet/configurer.rb +++ b/lib/puppet/configurer.rb @@ -77,12 +77,12 @@ class Puppet::Configurer end # Prepare for catalog retrieval. Downloads everything necessary, etc. - def prepare + def prepare(options) dostorage - download_plugins + download_plugins unless options[:skip_plugin_download] - download_fact_plugins + download_fact_plugins unless options[:skip_plugin_download] execute_prerun_command end @@ -126,7 +126,7 @@ class Puppet::Configurer # which accepts :tags and :ignoreschedules. def run(options = {}) begin - prepare + prepare(options) rescue SystemExit,NoMemoryError raise rescue Exception => detail |