From ccfe07dbd812890a732432bae7c2e522b79f643d Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 19 Jun 2018 18:28:16 -0700 Subject: deprecate old shell_out APIs note that this restores the behavior of shell_out_with_timeout() which downstream consumers may be using, and correctly treats custom resources and LWRPs the same, along with setting up removing all this backcompat weirdness in Chef-15. Signed-off-by: Lamont Granquist --- lib/chef/provider/package.rb | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'lib/chef/provider') diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb index ddd2fa5dd6..0af4f87d7f 100644 --- a/lib/chef/provider/package.rb +++ b/lib/chef/provider/package.rb @@ -668,27 +668,12 @@ class Chef end end - def shell_out_with_timeout(*command_args) # FIXME: deprecated - shell_out(*add_timeout_option(command_args)) + def shell_out_with_timeout(*command_args) + shell_out_compact_timeout(*command_args) end - def shell_out_with_timeout!(*command_args) # FIXME: deprecated - shell_out!(*add_timeout_option(command_args)) - end - - def add_timeout_option(command_args) - # this is deprecated but its not quite done yet - #Chef.deprecated(:package_misc, "shell_out_with_timeout and add_timeout_option are deprecated methods, use shell_out instead") - args = command_args.dup - if args.last.is_a?(Hash) - options = args.pop.dup - options[:timeout] = new_resource.timeout if new_resource.timeout - options[:timeout] = 900 unless options.key?(:timeout) - args << options - else - args << { timeout: new_resource.timeout ? new_resource.timeout : 900 } - end - args + def shell_out_with_timeout!(*command_args) + shell_out_compact_timeout!(*command_args) end end end -- cgit v1.2.1