Avoid crash if a module is not available on all arches
Theoretically it is possible, and this is the bare minimum of changes needed to survive such situation. There may be other pitfalls. Fixes: https://pagure.io/pungi/issue/1309 JIRA: COMPOSE-4016 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
0f53506765
commit
ce16e55ebd
@ -198,7 +198,7 @@ def create_variant_repo(compose, arch, variant, pkg_type, pkgset, modules_metada
|
||||
mod_index = Modulemd.ModuleIndex()
|
||||
metadata = []
|
||||
|
||||
for module_id, mmd in variant.arch_mmds[arch].items():
|
||||
for module_id, mmd in variant.arch_mmds.get(arch, {}).items():
|
||||
if modules_metadata:
|
||||
module_rpms = mmd.get_rpm_artifacts()
|
||||
metadata.append((module_id, module_rpms))
|
||||
|
@ -38,7 +38,7 @@ class GatherSourceModule(pungi.phases.gather.source.GatherSourceBase):
|
||||
|
||||
compatible_arches = pungi.arch.get_compatible_arches(arch, multilib=True)
|
||||
|
||||
for nsvc, module_stream in variant.arch_mmds[arch].items():
|
||||
for nsvc, module_stream in variant.arch_mmds.get(arch, {}).items():
|
||||
available_rpms = sum(
|
||||
(
|
||||
variant.nsvc_to_pkgset[nsvc].rpms_by_arch.get(a, [])
|
||||
|
Loading…
Reference in New Issue
Block a user