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-20250821.045427-reef~4^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a042017fb5afe164960fbe6048a925465b2d0943;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: