Fix relative symlinks creation in file module

Signed-off-by: Oleg Bulatov <oleg@bulatov.me>
This commit is contained in:
Oleg Bulatov 2014-09-01 23:23:36 +04:00
parent a098882fb9
commit 583cfa45e5

View file

@ -251,8 +251,8 @@ def main():
else:
relpath = os.path.dirname(path)
absrc = os.path.normpath('%s/%s' % (relpath, os.path.basename(src)))
if not os.path.exists(src) and not os.path.exists(absrc) and not force:
absrc = os.path.join(relpath, src)
if 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':