From a7c8bcda2e8b3c9d218555349d0440a9c9232fa1 Mon Sep 17 00:00:00 2001 From: Martin Hiner Date: Tue, 12 Mar 2024 11:07:09 +0100 Subject: [PATCH] Fix incorrect condition in kolla_container_facts Incorrect condition in Podman part prevented the retrieval of facts of all the containers when no names were provided. Closes-Bug: #2058492 Change-Id: I6d7f7ca0523eb17c7d9a9b93d2037bf77f2c2a47 Signed-off-by: Martin Hiner --- ansible/library/kolla_container_facts.py | 2 +- releasenotes/notes/bug-2058492-b86e8eceb04eec67.yaml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/bug-2058492-b86e8eceb04eec67.yaml diff --git a/ansible/library/kolla_container_facts.py b/ansible/library/kolla_container_facts.py index 3f75a44789..ef3617db26 100644 --- a/ansible/library/kolla_container_facts.py +++ b/ansible/library/kolla_container_facts.py @@ -104,7 +104,7 @@ def use_podman(module, results): for container in containers: container.reload() container_name = container.attrs['Name'] - if container_name not in names: + if names and container_name not in names: continue results['_containers'].append(container.attrs) results[container_name] = container.attrs diff --git a/releasenotes/notes/bug-2058492-b86e8eceb04eec67.yaml b/releasenotes/notes/bug-2058492-b86e8eceb04eec67.yaml new file mode 100644 index 0000000000..f1c1e735c3 --- /dev/null +++ b/releasenotes/notes/bug-2058492-b86e8eceb04eec67.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Incorrect condition in Podman part prevented the retrieval + of facts of all the containers when no names were provided. + `LP#2058492 `__