summaryrefslogtreecommitdiff
path: root/lib/ansible/module_utils/powershell
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2018-03-27 16:19:45 +1000
committerGitHub <noreply@github.com>2018-03-27 16:19:45 +1000
commit68e44e082e9ae1a52668c228f093a9c2de6a9602 (patch)
treef44b49b563578b50dc832ce1226846dbc598e96f /lib/ansible/module_utils/powershell
parent63da50e1d8fe61bbcdae645bf72a8482383e6a83 (diff)
downloadansible-68e44e082e9ae1a52668c228f093a9c2de6a9602.tar.gz
Ansible.ModuleUtils.FileUtil: catch DirectoryNotFoundException when testing a path (#37968)
Diffstat (limited to 'lib/ansible/module_utils/powershell')
-rw-r--r--lib/ansible/module_utils/powershell/Ansible.ModuleUtils.FileUtil.psm12
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.FileUtil.psm1 b/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.FileUtil.psm1
index 2e905593eb..727da967f6 100644
--- a/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.FileUtil.psm1
+++ b/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.FileUtil.psm1
@@ -17,7 +17,7 @@ Function Test-AnsiblePath {
# Replacement for Test-Path
try {
$file_attributes = [System.IO.File]::GetAttributes($Path)
- } catch [System.IO.FileNotFoundException] {
+ } catch [System.IO.FileNotFoundException], [System.IO.DirectoryNotFoundException] {
return $false
}