diff options
author | Luke Kanies <luke@madstop.com> | 2005-07-10 04:48:43 +0000 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2005-07-10 04:48:43 +0000 |
commit | 4157fa01f499bdcdba19a0a6096f14cb1dc710ab (patch) | |
tree | b584f1f31eaa1a3094493fc27b2bbe3f13aff80a /lib/puppet | |
parent | 2c1f6373802c3d1431cce7e750764b286b62c41c (diff) | |
download | puppet-4157fa01f499bdcdba19a0a6096f14cb1dc710ab.tar.gz puppet-4157fa01f499bdcdba19a0a6096f14cb1dc710ab.tar.xz puppet-4157fa01f499bdcdba19a0a6096f14cb1dc710ab.zip |
exec stuff all works now, end to end
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@349 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rwxr-xr-x | lib/puppet/type/exec.rb | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb index e981e67ca..421a1089a 100755 --- a/lib/puppet/type/exec.rb +++ b/lib/puppet/type/exec.rb @@ -48,6 +48,7 @@ module Puppet self.parent[:command] ) end + self.is = nil end def sync @@ -60,10 +61,7 @@ module Puppet ENV["PATH"] = tmppath - Puppet.debug("%s: status: %s; returns: %s" % - [self.parent[:command],status.exitstatus, self.should] - ) - if status.exitstatus != self.should + if status.exitstatus.to_s != self.should.to_s Puppet.err("%s returned %s" % [self.parent[:command],status.exitstatus]) @@ -80,9 +78,6 @@ module Puppet class Type class Exec < Type - attr_reader :command, :user, :returns - # class instance variable - # this is kind of hackish, using the return value as the # state, but apparently namevars can't also be states # who knew? @@ -101,10 +96,20 @@ module Puppet def initialize(hash) # default to erroring on a non-zero return - unless hash.include?("returns") or hash.include?(:returns) - hash["returns"] = 0 + if hash.include?("returns") + if hash["returns"].is_a?(Fixnum) + hash["returns"] = hash["returns"].to_s + end + elsif hash.include?(:returns) + if hash["returns"].is_a?(Fixnum) + hash[:returns] = hash[:returns].to_s + end + else + Puppet.debug("setting return to 0") + hash[:returns] = "0" end + super if self[:command].nil? |