]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
script/build-with-container: handle failure to find source rpm better
authorJohn Mulligan <jmulligan@redhat.com>
Thu, 8 May 2025 17:22:52 +0000 (13:22 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 12 Jun 2025 13:37:00 +0000 (09:37 -0400)
Don't use an obscure assert, raise an exception with a helpful error
message.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/script/build-with-container.py

index 0f925f1234adc89275a63a59d1f81980647f0469..33e53e82f76448ab20e047d13d76c5aea7bd8deb 100755 (executable)
@@ -717,7 +717,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: