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:
parent
aa6a1215cd
commit
129710a383
1 changed files with 5 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue