summaryrefslogtreecommitdiff
path: root/lib/chef/resource/execute.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/resource/execute.rb')
-rw-r--r--lib/chef/resource/execute.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb
index 6853b62887..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)