1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00

Fix idempotency for empty values (#790)

Fix #788
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
This commit is contained in:
Sergey 2024-06-20 09:53:16 +03:00 committed by GitHub
parent f9aa8878fd
commit 24c842fdd6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 42 additions and 0 deletions

View file

@ -404,11 +404,15 @@ def diff_generic(params, info_config, module_arg, cmd_arg, boolean_type=False):
after = ",".join(sorted([str(i).lower() for i in after]))
if before:
before = ",".join(sorted([str(i).lower() for i in before]))
else:
before = ''
elif isinstance(after, dict):
after = ",".join(sorted(
[str(k).lower() + "=" + str(v).lower() for k, v in after.items() if v is not None]))
if before:
before = ",".join(sorted([j.lower() for j in before]))
else:
before = ''
elif isinstance(after, bool):
after = str(after).capitalize()
if before is not None: