Skip to content

Commit

Permalink
Fix issue with symlink path detection
Browse files Browse the repository at this point in the history
  • Loading branch information
jimi-c committed Jun 5, 2014
1 parent 7483acd commit 43f96a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/files/file
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,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':
Expand Down

0 comments on commit 43f96a6

Please sign in to comment.