summaryrefslogtreecommitdiff
path: root/lib/chef/provider
diff options
context:
space:
mode:
authorMatt Wrock <matt@mattwrock.com>2016-02-11 18:57:44 -0800
committerMatt Wrock <matt@mattwrock.com>2016-02-11 18:57:44 -0800
commit0ef585544e196e451dbc30573ff5403905328f90 (patch)
tree3f20f6a8081a8a753544e76b95e851aa22ad16c6 /lib/chef/provider
parentc700c2d999a5767931cf43e6f8191ed5961d2137 (diff)
downloadchef-0ef585544e196e451dbc30573ff5403905328f90.tar.gz
do not include source parameter when removing a chocolatey package and ensure source is used on all functional testsno_web
Diffstat (limited to 'lib/chef/provider')
-rw-r--r--lib/chef/provider/package/chocolatey.rb7
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