diff options
author | Deepak Giridharagopal <deepak@brownman.org> | 2009-10-10 16:38:20 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-11-19 14:00:41 +1100 |
commit | 2d4b795e81e4f7953210d51be56c77bed3b77609 (patch) | |
tree | 5a79c9b16e774973034b822f978b4ecb2bdd01fd /lib/puppet/agent.rb | |
parent | 0f6181680974f8307eb4ef5e4f6b75b58a195321 (diff) | |
download | puppet-2d4b795e81e4f7953210d51be56c77bed3b77609.tar.gz puppet-2d4b795e81e4f7953210d51be56c77bed3b77609.tar.xz puppet-2d4b795e81e4f7953210d51be56c77bed3b77609.zip |
Fix #1934 - detailed-exitcodes for puppetd
This option only works when --onetime is specified, as it doesn't make
much sense to worry about exit codes in the context of a long-running
daemon.
This required a refactoring of the existing --detailed-exitcodes code,
as "puppetd" wasn't directly creating a transaction object (like
"puppet" does).
Added Report::exit_status, which did what was previously hard-coded
into the "puppet" executable.
An Agent's "run" method now returns a value (the result of the
individual client class' "run" method)
The "puppetd" agent's "run" method now returns a transaction report, as
that seems like the logical thing to return as the result of applying a
catalog.
Signed-off-by: Deepak Giridharagopal <deepak@brownman.org>
Diffstat (limited to 'lib/puppet/agent.rb')
-rw-r--r-- | lib/puppet/agent.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/puppet/agent.rb b/lib/puppet/agent.rb index a188df39e..7bd97415f 100644 --- a/lib/puppet/agent.rb +++ b/lib/puppet/agent.rb @@ -48,14 +48,16 @@ class Puppet::Agent return end splay + result = nil with_client do |client| begin - sync.synchronize { lock { client.run(*args) } } + sync.synchronize { lock { result = client.run(*args) } } rescue => detail puts detail.backtrace if Puppet[:trace] Puppet.err "Could not run %s: %s" % [client_class, detail] end end + result end def stop |