diff options
author | Matt Wrock <matt@mattwrock.com> | 2016-02-11 21:12:09 -0800 |
---|---|---|
committer | Matt Wrock <matt@mattwrock.com> | 2016-02-11 21:12:09 -0800 |
commit | 5d3239a311db57e419c5abcbfed9305013950729 (patch) | |
tree | 621f0b35070e9e08189806aee4ceed154ce8f000 /lib | |
parent | 78a8c4e8e7a791d604609c508eeb4f38fef5bd2a (diff) | |
parent | 0ef585544e196e451dbc30573ff5403905328f90 (diff) | |
download | chef-5d3239a311db57e419c5abcbfed9305013950729.tar.gz |
Merge pull request #4570 from chef/no_web
do not include source parameter when removing a chocolatey package and ensure source is used on all functional tests
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/package/chocolatey.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/chef/provider/package/chocolatey.rb b/lib/chef/provider/package/chocolatey.rb index 14613b0218..e111beb9b5 100644 --- a/lib/chef/provider/package/chocolatey.rb +++ b/lib/chef/provider/package/chocolatey.rb @@ -126,7 +126,7 @@ EOS # @param names [Array<String>] array of package names to install # @param versions [Array<String>] array of versions to install def remove_package(names, versions) - choco_command("uninstall -y", cmd_args, *names) + choco_command("uninstall -y", cmd_args(include_source: false), *names) end # Support :uninstall as an action in order for users to easily convert @@ -206,10 +206,11 @@ EOS # Helper to construct optional args out of new_resource # + # @param include_source [Boolean] should the source parameter be added # @return [String] options from new_resource or empty string - def cmd_args + def cmd_args(include_source: true) cmd_args = [ new_resource.options ] - cmd_args.push( "-source #{new_resource.source}" ) if new_resource.source + cmd_args.push( "-source #{new_resource.source}" ) if new_resource.source && include_source args_to_string(*cmd_args) end |