summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cammarata <jimi@sngx.net>2014-06-04 23:31:59 -0500
committerJames Cammarata <jimi@sngx.net>2014-06-09 14:14:02 -0500
commit58a0bcbe514736d116f65c915b4cce6b7706b54f (patch)
tree0e40d0ff251a835bd6bce09afe392ea83929b110
parent10074d3622fdba9caaf83ab6fe02f60db9b3a88b (diff)
downloadansible-58a0bcbe514736d116f65c915b4cce6b7706b54f.tar.gz
Fix issue with symlink path detection
Fixes #7627 Fixes #7664
-rw-r--r--library/files/file3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/files/file b/library/files/file
index 29c491b766..c719c82770 100644
--- a/library/files/file
+++ b/library/files/file
@@ -186,8 +186,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':