mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-02-04 07:11:49 +00:00
Fix pod info for non-existant pods (#732)
Do not try to deserialize json when out is empty Fixes #731 Signed-off-by: Oliver Walsh <owalsh@redhat.com>
This commit is contained in:
parent
7df5126cb3
commit
4591a44ef8
1 changed files with 1 additions and 1 deletions
|
|
@ -109,7 +109,7 @@ def get_pod_info(module, executable, name):
|
|||
rc, out, err = module.run_command(command + [pod])
|
||||
errs.append(err.strip())
|
||||
rcs += [rc]
|
||||
data = json.loads(out)
|
||||
data = json.loads(out) if out else None
|
||||
if isinstance(data, list) and data:
|
||||
data = data[0]
|
||||
if not out or data is None or not data:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue