diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2010-08-27 12:49:54 -0700 |
---|---|---|
committer | Jesse Wolfe <jes5199@gmail.com> | 2010-08-27 12:50:26 -0700 |
commit | 21afb51a1b84116b2a906a6959ae588f45135104 (patch) | |
tree | 48fa0438d0a50202194956344d0cf1f10b17b818 /lib/puppet/application | |
parent | 1f3070c4bc77b38e3dd6170cf6a58bee7ec337ac (diff) | |
parent | 8be1929043f4560bb17a4b06293b3f9a4efcfdbf (diff) | |
download | puppet-21afb51a1b84116b2a906a6959ae588f45135104.tar.gz puppet-21afb51a1b84116b2a906a6959ae588f45135104.tar.xz puppet-21afb51a1b84116b2a906a6959ae588f45135104.zip |
Merge commit '2.6.1rc3'
This synchronizes the 2.7 master branch with 2.6.1RC3
The 2.7 next branch has now diverged from master for the first time, as
if contains code that has not reached "release quality" status.
Diffstat (limited to 'lib/puppet/application')
-rw-r--r-- | lib/puppet/application/apply.rb | 20 | ||||
-rw-r--r-- | lib/puppet/application/queue.rb | 1 |
2 files changed, 15 insertions, 6 deletions
diff --git a/lib/puppet/application/apply.rb b/lib/puppet/application/apply.rb index bb4186dbd..59a95d35a 100644 --- a/lib/puppet/application/apply.rb +++ b/lib/puppet/application/apply.rb @@ -78,7 +78,10 @@ class Puppet::Application::Apply < Puppet::Application if options[:code] or command_line.args.length == 0 Puppet[:code] = options[:code] || STDIN.read else - Puppet[:manifest] = command_line.args.shift + manifest = command_line.args.shift + raise "Could not find file #{manifest}" unless File.exist?(manifest) + Puppet.warning("Only one file can be applied per run. Skipping #{command_line.args.join(', ')}") if command_line.args.size > 0 + Puppet[:manifest] = manifest end # Collect our facts. @@ -123,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 diff --git a/lib/puppet/application/queue.rb b/lib/puppet/application/queue.rb index 6df825dd1..6c90ca0a1 100644 --- a/lib/puppet/application/queue.rb +++ b/lib/puppet/application/queue.rb @@ -38,6 +38,7 @@ class Puppet::Application::Queue < Puppet::Application option("--verbose","-v") def main + require 'lib/puppet/indirector/catalog/queue' # provides Puppet::Indirector::Queue.subscribe Puppet.notice "Starting puppetqd #{Puppet.version}" Puppet::Resource::Catalog::Queue.subscribe do |catalog| # Once you have a Puppet::Resource::Catalog instance, calling save on it should suffice |