Commit c5fd3008 by James Cammarata

Merge pull request #7836 from trbs/file_symlink_notexists_checkmode

OSError in file module for non existing symlink in check mode.
parents 39291181 d5fa690a
...@@ -251,6 +251,9 @@ def main(): ...@@ -251,6 +251,9 @@ def main():
except OSError, e: except OSError, e:
module.fail_json(path=path, msg='Error while linking: %s' % str(e)) module.fail_json(path=path, msg='Error while linking: %s' % str(e))
if module.check_mode and not os.path.exists(path):
module.exit_json(dest=path, src=src, changed=changed)
changed = module.set_fs_attributes_if_different(file_args, changed) changed = module.set_fs_attributes_if_different(file_args, changed)
module.exit_json(dest=path, src=src, changed=changed) module.exit_json(dest=path, src=src, changed=changed)
......
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