diff options
author | David Schmitt <david@schmitt.edv-bus.at> | 2007-11-17 11:40:15 +0100 |
---|---|---|
committer | David Schmitt <david@schmitt.edv-bus.at> | 2007-11-17 11:40:15 +0100 |
commit | 4afbaa6f7042eb1cccc8938ee1ccb53c662ba41c (patch) | |
tree | a68d0518aacbb5992838fd0f4c7f6a0d517d5abb | |
parent | 32d9afce4dd732d49a3157ce05f47d6f468569b3 (diff) | |
download | puppet-4afbaa6f7042eb1cccc8938ee1ccb53c662ba41c.tar.gz puppet-4afbaa6f7042eb1cccc8938ee1ccb53c662ba41c.tar.xz puppet-4afbaa6f7042eb1cccc8938ee1ccb53c662ba41c.zip |
fix #903: add patch from hrvojehr
this moves logging of the command in front of failing from unexpected
return. This helps very much to debug exec failures.
Additionally I removed the unused local variable "loglevel"
-rwxr-xr-x | lib/puppet/type/exec.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb index 9aab4dbd7..b76426495 100755 --- a/lib/puppet/type/exec.rb +++ b/lib/puppet/type/exec.rb @@ -113,12 +113,6 @@ module Puppet self.fail "Command exceeded timeout" % value.inspect end - loglevel = @resource[:loglevel] - if status.exitstatus.to_s != self.should.to_s - self.fail("%s returned %s instead of %s" % - [self.resource[:command], status.exitstatus, self.should.to_s]) - end - if log = @resource[:logoutput] if log == :true log = @resource[:loglevel] @@ -130,6 +124,11 @@ module Puppet end end + if status.exitstatus.to_s != self.should.to_s + self.fail("%s returned %s instead of %s" % + [self.resource[:command], status.exitstatus, self.should.to_s]) + end + return event end end |