mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Show diff when file: state=link changes the symlink target (#22243)
* Show diff when file: state=link changes the symlink target * Integration test for symlink target change * Also check soft link idempotency
This commit is contained in:
committed by
Brian Coca
parent
228131d1cd
commit
15c7288ab9
@@ -392,6 +392,8 @@ def main():
|
||||
elif prev_state == 'link':
|
||||
b_old_src = os.readlink(b_path)
|
||||
if b_old_src != b_src:
|
||||
diff['before']['src'] = to_native(b_old_src, errors='strict')
|
||||
diff['after']['src'] = src
|
||||
changed = True
|
||||
elif prev_state == 'hard':
|
||||
if not (state == 'hard' and os.stat(b_path).st_ino == os.stat(b_src).st_ino):
|
||||
|
||||
Reference in New Issue
Block a user