mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Ansible.ModuleUtils.FileUtil: catch DirectoryNotFoundException when testing a path (#37968)
This commit is contained in:
parent
63da50e1d8
commit
68e44e082e
3 changed files with 22 additions and 1 deletions
|
@ -144,6 +144,19 @@
|
|||
that:
|
||||
- statout.stat.exists == true
|
||||
|
||||
# https://github.com/ansible/ansible/issues/37967
|
||||
- name: test creates with file in missing directory
|
||||
win_shell: echo hi
|
||||
args:
|
||||
creates: c:\fakefolder\fakefolder2\fakefile.txt
|
||||
register: shellout
|
||||
|
||||
- name: validate result
|
||||
assert:
|
||||
that:
|
||||
- shellout.skipped is not defined
|
||||
- shellout.changed
|
||||
|
||||
- name: run with removes, should remove
|
||||
win_shell: Remove-Item c:\testfile.txt
|
||||
args:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue