mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
Fix #7711
Fix relative symlinks creation in file module Signed-off-by: Oleg Bulatov <oleg@bulatov.me>
This commit is contained in:
parent
dac11904cb
commit
a7d38702d9
2 changed files with 39 additions and 2 deletions
|
@ -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':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue