From 8aba2363e234e239a470437266202e3f3e8608ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 25 Aug 2022 10:59:15 +0200 Subject: [PATCH] pkgset: Report better error when module is missing an arch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pungi expects each module to be built for all architectures by default. Unless the module is filtered out, missing metadata for a particular arch would cause it to crash with a incomprehensible error message. This should make it a little better. Relates: https://pagure.io/releng/failed-composes/issue/3889 Signed-off-by: Lubomír Sedlář --- pungi/phases/pkgset/sources/source_koji.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pungi/phases/pkgset/sources/source_koji.py b/pungi/phases/pkgset/sources/source_koji.py index 90a81019..26ec770e 100644 --- a/pungi/phases/pkgset/sources/source_koji.py +++ b/pungi/phases/pkgset/sources/source_koji.py @@ -264,8 +264,14 @@ def _add_module_to_variant( compose.log_debug("Module %s is filtered from %s.%s", nsvc, variant, arch) continue + filename = "modulemd.%s.txt" % arch + if filename not in mmds: + raise RuntimeError( + "Module %s does not have metadata for arch %s and is not filtered " + "out via filter_modules option." % (nsvc, arch) + ) mod_stream = read_single_module_stream_from_file( - mmds["modulemd.%s.txt" % arch], compose, arch, build + mmds[filename], compose, arch, build ) if mod_stream: added = True