From 583cfa45e51b53915e35b3fed1471bcf91edc13c Mon Sep 17 00:00:00 2001 From: Oleg Bulatov Date: Mon, 1 Sep 2014 23:23:36 +0400 Subject: [PATCH] Fix #7711 Fix relative symlinks creation in file module Signed-off-by: Oleg Bulatov --- files/file | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/file b/files/file index 82f4d5016d5..4541d24d85f 100644 --- a/files/file +++ b/files/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':