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 <martin.hiner@tietoevry.com>
This commit is contained in:
Martin Hiner 2024-03-12 11:07:09 +01:00
parent 8c760d38a0
commit a7c8bcda2e
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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 <https://launchpad.net/bugs/2058492>`__