diff --git a/files/file b/files/file index 2f26a3bc312..ff9feb41ee3 100644 --- a/files/file +++ b/files/file @@ -257,8 +257,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':