summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-10-26 17:42:58 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-10-26 17:42:58 -0700
commitdca903c1e9a13cc87f400b804412c80da6312f55 (patch)
treeea2619a96b5ba97b45a1cdfe815a4b7aa48d0576
parente695014e818d8ef9bbfbd3157f9973c412580431 (diff)
downloadchef-dca903c1e9a13cc87f400b804412c80da6312f55.tar.gz
this still needs to be restricted to only providers
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/mixin/shell_out.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/mixin/shell_out.rb b/lib/chef/mixin/shell_out.rb
index 1ca272b805..a96bd1527f 100644
--- a/lib/chef/mixin/shell_out.rb
+++ b/lib/chef/mixin/shell_out.rb
@@ -75,7 +75,9 @@ class Chef
# historically resources have not properly declared defaults on their timeouts, so a default default of 900s was enforced here
default_val = 900
return options if options.key?(:timeout)
- if obj.respond_to?(:new_resource) && obj.new_resource.respond_to?(:timeout) && !options.key?(:timeout)
+ # FIXME: need to nuke descendents tracker out of Chef::Provider so we can just define that class here without requiring the
+ # world, and then just use symbol lookup
+ if obj.class.ancestors.map(&:name).include?("Chef::Provider") && obj.respond_to?(:new_resource) && obj.new_resource.respond_to?(:timeout) && !options.key?(:timeout)
options[:timeout] = obj.new_resource.timeout ? obj.new_resource.timeout.to_f : default_val
end
options