Commit aa1f9f24 by jctanner

Merge pull request #5264 from drewlll2ll/file-fix

file module: Fixed missing prev_state == 'directory' in file
parents d6b78e9d 54a28eb4
...@@ -307,6 +307,10 @@ def main(): ...@@ -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')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment