From 4591a44ef8464bcfffda35ad8bbcedc6b11e246e Mon Sep 17 00:00:00 2001 From: Oliver Walsh Date: Fri, 12 Apr 2024 14:24:13 +0100 Subject: [PATCH] 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 --- plugins/modules/podman_pod_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/podman_pod_info.py b/plugins/modules/podman_pod_info.py index e804266..8597ae9 100644 --- a/plugins/modules/podman_pod_info.py +++ b/plugins/modules/podman_pod_info.py @@ -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: