diff options
author | Jordan Borean <jborean93@gmail.com> | 2018-03-27 16:19:45 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-27 16:19:45 +1000 |
commit | 68e44e082e9ae1a52668c228f093a9c2de6a9602 (patch) | |
tree | f44b49b563578b50dc832ce1226846dbc598e96f /lib/ansible/module_utils/powershell | |
parent | 63da50e1d8fe61bbcdae645bf72a8482383e6a83 (diff) | |
download | ansible-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.psm1 | 2 |
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 } |