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

Merge pull request #5264 from drewlll2ll/file-fix

file module: Fixed missing prev_state == 'directory' in file
This commit is contained in:
jctanner 2014-01-06 14:07:07 -08:00
commit aa1f9f24c3

View file

@ -307,6 +307,10 @@ def main():
if not force: if not force:
module.fail_json(dest=path, src=src, msg='Cannot link, file exists at destination') module.fail_json(dest=path, src=src, msg='Cannot link, file exists at destination')
changed = True changed = True
elif prev_state == 'directory':
if not force:
module.fail_json(dest=path, src=src, msg='Cannot link, directory exists at destination')
changed = True
else: else:
module.fail_json(dest=path, src=src, msg='unexpected position reached') module.fail_json(dest=path, src=src, msg='unexpected position reached')