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

Fix broken info of pods in Podman v5

Fixing issue from:
https://github.com/containers/podman/pull/21514
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
This commit is contained in:
Sagi Shnaidman 2024-02-18 02:09:38 +02:00 committed by Sergey
parent aa6a1215cd
commit 129710a383

View file

@ -109,9 +109,12 @@ def get_pod_info(module, executable, name):
rc, out, err = module.run_command(command + [pod])
errs.append(err.strip())
rcs += [rc]
if not out or json.loads(out) is None or not json.loads(out):
data = json.loads(out)
if isinstance(data, list) and data:
data = data[0]
if not out or data is None or not data:
continue
result.append(json.loads(out))
result.append(data)
return result, errs, rcs