mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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
This commit is contained in:
parent
ad97c618cf
commit
7483acde5d
1 changed files with 1 additions and 1 deletions
|
@ -189,7 +189,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)
|
||||
|
|
Loading…
Reference in a new issue