diff options
author | Vivek Singh <vivek.singh@msystechnologies.com> | 2019-02-12 17:47:12 +0530 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2019-03-04 09:45:03 -0800 |
commit | 9fa266b8a3c86b770fe58324f20421743568874e (patch) | |
tree | 8c564a60b020f7fb68424a9b03d6ef440a6157e8 | |
parent | 98777cd43824fe4d412edde672f330f30ed40ac3 (diff) | |
download | chef-9fa266b8a3c86b770fe58324f20421743568874e.tar.gz |
Authentication on chocolatey_package
- Add missing options cmd args while fetching choco list.
- Fixed rspec.
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
-rw-r--r-- | lib/chef/provider/package/chocolatey.rb | 2 | ||||
-rw-r--r-- | spec/unit/provider/package/chocolatey_spec.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/provider/package/chocolatey.rb b/lib/chef/provider/package/chocolatey.rb index 4c35d13a07..f9e5027097 100644 --- a/lib/chef/provider/package/chocolatey.rb +++ b/lib/chef/provider/package/chocolatey.rb @@ -236,6 +236,8 @@ EOS begin cmd = [ "list -r #{pkg}" ] cmd.push( "-source #{new_resource.source}" ) if new_resource.source + cmd.push( new_resource.options ) if new_resource.options + raw = parse_list_output(*cmd) raw.keys.each_with_object({}) do |name, available| available[name] = desired_name_versions[name] || raw[name] diff --git a/spec/unit/provider/package/chocolatey_spec.rb b/spec/unit/provider/package/chocolatey_spec.rb index 48f8a562de..0b504b9a35 100644 --- a/spec/unit/provider/package/chocolatey_spec.rb +++ b/spec/unit/provider/package/chocolatey_spec.rb @@ -282,7 +282,7 @@ describe Chef::Provider::Package::Chocolatey do end it "should pass options into the install command" do - allow_remote_list(["git"]) + allow_remote_list(["git"], " -force") new_resource.options("-force") provider.load_current_resource expect(provider).to receive(:shell_out_compacted!).with("#{choco_exe} install -y -force git", { returns: [0], timeout: timeout }).and_return(double) |