Skip to content

Commit

Permalink
Fix pod info for non-existant pods (#732)
Browse files Browse the repository at this point in the history
Do not try to deserialize json when out is empty

Fixes #731

Signed-off-by: Oliver Walsh <owalsh@redhat.com>
  • Loading branch information
olliewalsh authored Apr 12, 2024
1 parent 7df5126 commit 4591a44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/modules/podman_pod_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4591a44

Please sign in to comment.