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

fix(podman_prune): set top-level changed status (#997)

* fix(podman_prune): set top-level changed status

The module was returning changed status inside nested dicts,
but Ansible expects it at the top level of the result.

Before: {"image": {"changed": true, ...}} -> Ansible sees changed=false
After:  {"changed": true, "image": {...}} -> Ansible sees changed=true
Signed-off-by: Igor Belousov <igor-belousov@users.noreply.github.com>

* Update plugins/modules/podman_prune.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Igor Belousov <igor-belousov@users.noreply.github.com>

---------

Signed-off-by: Igor Belousov <igor-belousov@users.noreply.github.com>
Co-authored-by: Igor Belousov <igor-belousov@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
igor-belousov 2026-01-15 14:04:16 +03:00 committed by GitHub
parent 0d653874d3
commit 5416c5dfd8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -251,7 +251,10 @@ def main():
system_filters["system_volumes"] = "--volumes" system_filters["system_volumes"] = "--volumes"
results[target] = podmanExec(module, target, system_filters, executable) results[target] = podmanExec(module, target, system_filters, executable)
module.exit_json(**results) # Calculate global changed status from all targets
changed = any(res.get("changed", False) for res in results.values())
module.exit_json(changed=changed, **results)
if __name__ == "__main__": if __name__ == "__main__":