summaryrefslogtreecommitdiff
path: root/lib/chef/mixin
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-06-18 10:12:48 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-06-18 10:12:48 -0700
commit49ef48d9292363f3c8f8c3a1888a8648dbfcdba9 (patch)
tree2cc36956ca4a812628d93491195c8a577cbbf78e /lib/chef/mixin
parent9582fcbe1aad72c8a7f776ae47ed3996cd5301e7 (diff)
downloadchef-49ef48d9292363f3c8f8c3a1888a8648dbfcdba9.tar.gz
add comment about odd construction herelcg/deprecate-shell-out-compact-timeout
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/mixin')
-rw-r--r--lib/chef/mixin/shell_out.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/chef/mixin/shell_out.rb b/lib/chef/mixin/shell_out.rb
index 052ba5e94c..2c67d34630 100644
--- a/lib/chef/mixin/shell_out.rb
+++ b/lib/chef/mixin/shell_out.rb
@@ -125,6 +125,9 @@ class Chef
# module method to not pollute namespaces, but that means we need self injected as an arg
# @api private
def self.maybe_add_timeout(obj, options)
+ # note that we can't define an empty Chef::Resource::LWRPBase because that breaks descendants tracker, so we'd have to instead require the file here, which would pull in half
+ # of chef, so instead convert to using strings. once descendants tracker is gone, we can just declare the empty classes instead and use `is_a?` against the symbols.
+ # (be nice if ruby supported strings in `is_a?` for looser coupling).
if obj.class.ancestors.map(&:to_s).include?("Chef::Provider") && !obj.class.ancestors.map(&:to_s).include?("Chef::Resource::LWRPBase") && obj.new_resource.respond_to?(:timeout) && !options.key?(:timeout)
options = options.dup
# historically resources have not properly declared defaults on their timeouts, so a default default of 900s was enforced here