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

Fix issue with symlink path detection

Fixes #7627
Fixes #7664
This commit is contained in:
James Cammarata 2014-06-04 23:31:59 -05:00
parent 7483acde5d
commit 43f96a636b

View file

@ -193,8 +193,9 @@ def main():
relpath = path
else:
relpath = os.path.dirname(path)
absrc = os.path.normpath('%s/%s' % (relpath, os.path.basename(src)))
if not os.path.exists(absrc) and not force:
if not os.path.exists(src) and not os.path.exists(absrc) and not force:
module.fail_json(path=path, src=src, msg='src file does not exist, use "force=yes" if you really want to create the link: %s' % absrc)
if state == 'hard':