mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-02 16:53:11 +00: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user