From 36c47db08d215d202cef5e6a421b5389494121ab Mon Sep 17 00:00:00 2001 From: John McCrae Date: Thu, 4 Feb 2021 10:56:21 -0800 Subject: corrected an error with the delete method where the store_name was not being declared. Also cleaned up a piece of powershell that was being passed the native store name and not the powershell store name Signed-off-by: John McCrae --- lib/chef/resource/windows_certificate.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/chef/resource/windows_certificate.rb b/lib/chef/resource/windows_certificate.rb index 417f673ec2..0879f04636 100644 --- a/lib/chef/resource/windows_certificate.rb +++ b/lib/chef/resource/windows_certificate.rb @@ -177,7 +177,7 @@ class Chef end def delete_cert - store = ::Win32::Certstore.open(new_resource.store_name) + store = ::Win32::Certstore.open(new_resource.store_name, store_location: native_cert_location) store.delete(resolve_thumbprint(new_resource.source)) end @@ -266,7 +266,7 @@ class Chef def cert_script(persist) cert_script = "$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2" - file = Chef::Util::PathHelper.cleanpath(new_resource.source, native_cert_location) + file = Chef::Util::PathHelper.cleanpath(new_resource.source, ps_cert_location) cert_script << " \"#{file}\"" if ::File.extname(file.downcase) == ".pfx" cert_script << ", \"#{new_resource.pfx_password}\"" -- cgit v1.2.1