From: Daan De Meyer Date: Fri, 4 Aug 2023 14:38:05 +0000 (+0200) Subject: Don't log stacktraces for non-zero exits from ssh, qemu or systemd-nspawn X-Git-Tag: v15~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f61dac009ee584797e61a961d508cc52d7f4a03c;p=thirdparty%2Fmkosi.git Don't log stacktraces for non-zero exits from ssh, qemu or systemd-nspawn --- diff --git a/mkosi/__main__.py b/mkosi/__main__.py index db091f63a..deb1ebf71 100644 --- a/mkosi/__main__.py +++ b/mkosi/__main__.py @@ -30,7 +30,8 @@ def propagate_failed_return() -> Iterator[None]: sys.exit(1) except subprocess.CalledProcessError as e: - if ARG_DEBUG.get(): + # Failures from qemu, ssh and systemd-nspawn are expected and we won't log stacktraces for those. + if ARG_DEBUG.get() and e.cmd and e.cmd[0] not in ("qemu", "ssh", "systemd-nspawn"): sys.excepthook(*ensure_exc_info()) # We always log when subprocess.CalledProcessError is raised, so we don't log again here.