1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fixes #9518 - "file state=directory" silently skips if it's currently a file

This commit is contained in:
sysadmin75 2014-12-13 15:14:32 -05:00 committed by Matt Clay
parent 8621f9a7cd
commit 7fbb422ae7

View file

@ -240,6 +240,10 @@ def main():
tmp_file_args['path']=curpath
changed = module.set_fs_attributes_if_different(tmp_file_args, changed)
# We already know prev_state is not 'absent', therefore it exists in some form.
elif prev_state != 'directory':
module.fail_json(path=path, msg='%s already exists as a %s' % (path, prev_state))
changed = module.set_fs_attributes_if_different(file_args, changed)
if recurse: