mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-13 23:40:02 +08:00
Fix handling of getting "modulemd: null" in MBS verbose response
The code made some half-hearted attemps to handle a MBS verbose query missing the modulemd data, but it didn't do anything logically consistent - fix it to consistently ignore such modules.
This commit is contained in:
@@ -144,18 +144,16 @@ class MBSResolver(KojiResolver):
|
||||
if not modules:
|
||||
return []
|
||||
|
||||
yaml = None
|
||||
mmds = []
|
||||
for module in modules:
|
||||
if module:
|
||||
yaml = module["modulemd"]
|
||||
|
||||
yaml = module["modulemd"]
|
||||
if not yaml:
|
||||
if strict:
|
||||
raise UnprocessableEntity(
|
||||
"Failed to find modulemd entry in MBS for %r" % module)
|
||||
else:
|
||||
return None
|
||||
log.warning("Failed to find modulemd entry in MBS for %r", module)
|
||||
continue
|
||||
|
||||
mmds.append(load_mmd(yaml))
|
||||
return mmds
|
||||
@@ -363,7 +361,10 @@ class MBSResolver(KojiResolver):
|
||||
else:
|
||||
queried_module = self.get_module(name, stream, version, context, strict=strict)
|
||||
yaml = queried_module["modulemd"]
|
||||
queried_mmd = load_mmd(yaml)
|
||||
if yaml:
|
||||
queried_mmd = load_mmd(yaml)
|
||||
else:
|
||||
queried_mmd = None
|
||||
|
||||
if not queried_mmd or "buildrequires" not in queried_mmd.get_xmd().get("mbs", {}):
|
||||
raise RuntimeError(
|
||||
|
||||
Reference in New Issue
Block a user