From 441e4ff99f1a2e9c0b4e921d5e17818fa9b6e5bf 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) (cherry picked from commit 1126f76d4db3192051ea4da8d0b3bfbad2e6fca2) --- 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 31d2706823..3ef670b8c5 100644 --- a/lib/ansible/modules/windows/win_certificate_store.ps1 +++ b/lib/ansible/modules/windows/win_certificate_store.ps1 @@ -108,7 +108,7 @@ Function New-CertFile($cert, $path, $type, $password) { Fail-Json -obj $result -message "Failed to write cert to file, cert was null: $($_.Exception.Message)" } catch [System.IO.IOException] { Fail-Json -obj $result -message "Failed to write cert to file due to IO exception: $($_.Exception.Message)" - } catch [System.UnauthorizedAccessException, System>Security.SecurityException] { + } catch [System.UnauthorizedAccessException, System.Security.SecurityException] { Fail-Json -obj $result -message "Failed to write cert to file due to permission: $($_.Exception.Message)" } catch { Fail-Json -obj $result -message "Failed to write cert to file: $($_.Exception.Message)"