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:
parent
0d653874d3
commit
5416c5dfd8
1 changed files with 4 additions and 1 deletions
|
|
@ -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__":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue