From 1126f76d4db3192051ea4da8d0b3bfbad2e6fca2 Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Mon, 25 Feb 2019 13:00:04 +1000 Subject: [PATCH] win_certificate_store - Fix exception handling typo (#52906) --- changelogs/fragments/win_certificate_store-excp.yaml | 2 ++ lib/ansible/modules/windows/win_certificate_store.ps1 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/win_certificate_store-excp.yaml diff --git a/changelogs/fragments/win_certificate_store-excp.yaml b/changelogs/fragments/win_certificate_store-excp.yaml new file mode 100644 index 0000000000..2d500e711f --- /dev/null +++ b/changelogs/fragments/win_certificate_store-excp.yaml @@ -0,0 +1,2 @@ +bugfixes: +- win_certificate_store - Fix exception handling typo diff --git a/lib/ansible/modules/windows/win_certificate_store.ps1 b/lib/ansible/modules/windows/win_certificate_store.ps1 index 39af21bbb4..faf0ad6ffd 100644 --- a/lib/ansible/modules/windows/win_certificate_store.ps1 +++ b/lib/ansible/modules/windows/win_certificate_store.ps1 @@ -109,7 +109,7 @@ Function New-CertFile($module, $cert, $path, $type, $password) { $module.FailJson("Failed to write cert to file, cert was null: $($_.Exception.Message)", $_) } catch [System.IO.IOException] { $module.FailJson("Failed to write cert to file due to IO Exception: $($_.Exception.Message)", $_) - } catch [System.UnauthorizedAccessException, System>Security.SecurityException] { + } catch [System.UnauthorizedAccessException, System.Security.SecurityException] { $module.FailJson("Failed to write cert to file due to permissions: $($_.Exception.Message)", $_) } catch { $module.FailJson("Failed to write cert to file: $($_.Exception.Message)", $_)