diff options
author | vasu1105 <vasundhara.jagdale@msystechnologies.com> | 2018-11-29 15:03:29 +0530 |
---|---|---|
committer | vasu1105 <vasundhara.jagdale@msystechnologies.com> | 2018-12-19 14:23:50 +0530 |
commit | 26e4c73790b87dd0f4004c65f99f0c69ede96ee0 (patch) | |
tree | ecc35eb8c4ba1efe1e124277c78d7863c7b26f17 /lib/chef | |
parent | f840677605ccdf9e15e742163028b069eeb8b6e8 (diff) | |
download | chef-26e4c73790b87dd0f4004c65f99f0c69ede96ee0.tar.gz |
MSYS-936 Fix for windows certificate delete action fails if certificate doesn't exist
Signed-off-by: vasu1105 <vasundhara.jagdale@msystechnologies.com>
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/resource/windows_certificate.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/chef/resource/windows_certificate.rb b/lib/chef/resource/windows_certificate.rb index 053a67e3e0..0de1fbcfc6 100644 --- a/lib/chef/resource/windows_certificate.rb +++ b/lib/chef/resource/windows_certificate.rb @@ -58,7 +58,6 @@ class Chef action :create do description "Creates or updates a certificate." - add_cert(OpenSSL::X509::Certificate.new(raw_source)) end @@ -90,8 +89,12 @@ class Chef action :delete do description "Deletes a certificate." - - delete_cert + cert_obj = fetch_cert + if cert_obj + converge_by("Deleting certificate #{new_resource.source} from Store #{new_resource.store_name}") do + delete_cert + end + end end action :fetch do |