diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-06-04 09:49:39 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-06-04 09:49:39 -0700 |
commit | c15d7d0622e908bebaba6c1b84080c3cda521471 (patch) | |
tree | 2b6879e9a8ffa8d4d44c55f7efac7790feee336d | |
parent | b22da295fda4545d0e72e0edb6ae1f400b3d5c33 (diff) | |
download | chef-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.rb | 7 | ||||
-rw-r--r-- | lib/chef/provider/package.rb | 2 |
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 |