summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-06-04 09:49:39 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-06-04 09:49:39 -0700
commitc15d7d0622e908bebaba6c1b84080c3cda521471 (patch)
tree2b6879e9a8ffa8d4d44c55f7efac7790feee336d
parentb22da295fda4545d0e72e0edb6ae1f400b3d5c33 (diff)
downloadchef-c15d7d0622e908bebaba6c1b84080c3cda521471.tar.gz
move maybe_add_timeout to module method for privacy
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/mixin/shell_out.rb7
-rw-r--r--lib/chef/provider/package.rb2
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/chef/mixin/shell_out.rb b/lib/chef/mixin/shell_out.rb
index 870bdcdbf5..6cacd46312 100644
--- a/lib/chef/mixin/shell_out.rb
+++ b/lib/chef/mixin/shell_out.rb
@@ -62,7 +62,7 @@ class Chef
#
def shell_out_compact(*args, **options)
- options = maybe_add_timeout(options)
+ options = Chef::Mixin::ShellOut.maybe_add_timeout(options)
if options.empty?
shell_out(*clean_array(*args))
else
@@ -71,7 +71,7 @@ class Chef
end
def shell_out_compact!(*args, **options)
- options = maybe_add_timeout(options)
+ options = Chef::Mixin::ShellOut.maybe_add_timeout(options)
if options.empty?
shell_out!(*clean_array(*args))
else
@@ -79,7 +79,8 @@ class Chef
end
end
- def maybe_add_timeout(options)
+ # @api private
+ def self.maybe_add_timeout(options)
if is_a?(Chef::Provider) && !new_resource.is_a?(Chef::Resource::LWRPBase) && 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
diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb
index 408c54dc3d..6a7b2bc276 100644
--- a/lib/chef/provider/package.rb
+++ b/lib/chef/provider/package.rb
@@ -307,7 +307,7 @@ class Chef
# used by subclasses. deprecated. use #a_to_s instead.
def expand_options(options)
# its deprecated but still work to do to deprecate it fully
- #Chef.deprecated(:package_misc, "expand_options is deprecated, use shell_out_compact or shell_out_compact instead")
+ #Chef.deprecated(:package_misc, "expand_options is deprecated, use shell_out_compact instead")
if options
" #{options.is_a?(Array) ? Shellwords.join(options) : options}"
else