summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCrae <john.mccrae@progress.com>2021-02-04 10:56:21 -0800
committerJohn McCrae <john.mccrae@progress.com>2021-02-04 10:56:21 -0800
commit36c47db08d215d202cef5e6a421b5389494121ab (patch)
tree36ac9f769a7be2a2d928f3980d0f998516e28380
parentf59897faadc2d8009dbe5a4667492fbf11cb77ef (diff)
downloadchef-cert_stuff.tar.gz
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 namecert_stuff
Signed-off-by: John McCrae <john.mccrae@progress.com>
-rw-r--r--lib/chef/resource/windows_certificate.rb4
1 files 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}\""