diff options
Diffstat (limited to 'lib/chef/resource/execute.rb')
-rw-r--r-- | lib/chef/resource/execute.rb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb index 4fbaaf93ab..9f8b629fb8 100644 --- a/lib/chef/resource/execute.rb +++ b/lib/chef/resource/execute.rb @@ -26,6 +26,12 @@ class Chef identity_attr :command + # The ResourceGuardInterpreter wraps a resource's guards in another resource. That inner resource + # needs to behave differently during (for example) why_run mode, so we flag it here. For why_run mode + # we still want to execute the guard resource even if we are not executing the wrapping resource. + # Only execute resources (and subclasses) can be guard interpreters. + attr_accessor :is_guard_interpreter + def initialize(name, run_context=nil) super @resource_name = :execute @@ -43,6 +49,7 @@ class Chef @allowed_actions.push(:run) @umask = nil @default_guard_interpreter = :execute + @is_guard_interpreter = false end def umask(arg=nil) @@ -117,7 +124,7 @@ class Chef set_or_return( :timeout, arg, - :kind_of => [ Integer ] + :kind_of => [ Integer, Float ] ) end @@ -146,12 +153,12 @@ class Chef end set_guard_inherited_attributes( - :cwd, - :environment, - :group, - :user, - :umask - ) + :cwd, + :environment, + :group, + :user, + :umask + ) end end |