Do not fail on empty 'docker compose images' output. (#1305)

This commit is contained in:
Felix Fontein
2026-08-07 12:26:34 +02:00
committed by GitHub
parent b7b684b9c5
commit bc8f6a6906
3 changed files with 16 additions and 6 deletions
+3
View File
@@ -186,12 +186,15 @@ class AnsibleDockerClientBase:
cwd: str | None = None,
environ_update: dict[str, str] | None = None,
warn_on_stderr: bool = False,
parse_empty_as_none: bool = False,
) -> tuple[int, t.Any, bytes]:
rc, stdout, stderr = self.call_cli(
*args, check_rc=check_rc, data=data, cwd=cwd, environ_update=environ_update
)
if warn_on_stderr and stderr:
self.warn(to_text(stderr))
if parse_empty_as_none and not stdout.strip():
return rc, None, stderr
try:
data = json.loads(stdout)
except Exception as exc: # pylint: disable=broad-exception-caught