summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorJames Cammarata <jimi@sngx.net>2014-06-04 22:48:08 -0500
committerJames Cammarata <jimi@sngx.net>2014-06-09 14:13:55 -0500
commit10074d3622fdba9caaf83ab6fe02f60db9b3a88b (patch)
treef7fcb22482bfb93b74f4e88a01e11e967748a6c2 /library
parent2625196f5d903d0ea5c10c44802beae27a38d46b (diff)
downloadansible-10074d3622fdba9caaf83ab6fe02f60db9b3a88b.tar.gz
Fix linking issue to directories in file module
The os.path.isdir() returns True for symlinks that point to directories, so we also need to check to make sure it's not a symlink too. Fixes #7657
Diffstat (limited to 'library')
-rw-r--r--library/files/file2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/files/file b/library/files/file
index d2a20dbb7a..29c491b766 100644
--- a/library/files/file
+++ b/library/files/file
@@ -182,7 +182,7 @@ def main():
elif state in ['link','hard']:
- if os.path.isdir(path):
+ if os.path.isdir(path) and not os.path.islink(path):
relpath = path
else:
relpath = os.path.dirname(path)