From e70f66d2dfd520df5a1a675bb157a8933a9530bc Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Sun, 1 Nov 2026 12:24:51 +0100 Subject: [PATCH] Fail imgutil build when apt fails in an Ubuntu image DebHandler raised SystemExit on a failed apt-get, but prep_root runs under run_constrained, which only catches Exception and otherwise exits 0. A failed package install was therefore reported as a successful build. Raise an Exception instead, as ElHandler already does. --- imgutil/imgutil | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgutil/imgutil b/imgutil/imgutil index 0bf73230..e695ec26 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -797,7 +797,8 @@ class DebHandler(OsHandler): if rc: sys.stderr.write('{0} failed with exit code {1}\n'.format( ' '.join(cmd), rc)) - raise SystemExit(rc) + # not SystemExit, run_constrained would turn it into success + raise Exception('apt failed in image') def prep_root(self, args): mkdirp(os.path.join(self.targpath, 'etc/apt'))