From: John Mulligan Date: Thu, 8 May 2025 17:22:52 +0000 (-0400) Subject: script/build-with-container: handle failure to find source rpm better X-Git-Tag: testing/wip-jcollin-testing-20250823.034751-tentacle~5^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=80fad0464a5250eb37814711675d7ef3a3f2049e;p=ceph-ci.git script/build-with-container: handle failure to find source rpm better Don't use an obscure assert, raise an exception with a helpful error message. Signed-off-by: John Mulligan (cherry picked from commit 7cd048c2ee21935312c3b05c9b128c183b4e6ad8) --- diff --git a/src/script/build-with-container.py b/src/script/build-with-container.py index ab418284a69..ad49e49fb7f 100755 --- a/src/script/build-with-container.py +++ b/src/script/build-with-container.py @@ -732,7 +732,10 @@ def bc_build_rpm(ctx): # no matches. build a new srpm ctx.build.wants(Steps.SOURCE_RPM, ctx) paths = _glob_search(ctx, srpm_glob) - assert paths + if not paths: + raise RuntimeError( + f"unable to find source rpm(s) matching {srpm_glob}" + ) srpm_path = pathlib.Path(ctx.cli.homedir) / paths[0] topdir = pathlib.Path(ctx.cli.homedir) / "rpmbuild" if ctx.cli.build_dir: