summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-10-26 18:51:54 -0700
committerGitHub <noreply@github.com>2018-10-26 18:51:54 -0700
commit944651f6d59580b732720e48e4fc5594a60e2d61 (patch)
treeea2619a96b5ba97b45a1cdfe815a4b7aa48d0576
parente695014e818d8ef9bbfbd3157f9973c412580431 (diff)
parentdca903c1e9a13cc87f400b804412c80da6312f55 (diff)
downloadchef-944651f6d59580b732720e48e4fc5594a60e2d61.tar.gz
Merge pull request #7793 from chef/lcg/chef-15-shell-out-edge-condition
shell_out auto-timeout still needs to be restricted to only providers
-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