| |
@@ -280,6 +280,7 @@
|
| |
", ".join([name, stream, str(version), context]), strict)
|
| |
)
|
| |
|
| |
+ module_build = None
|
| |
module_tags = {}
|
| |
if mmd:
|
| |
queried_mmd = mmd
|
| |
@@ -290,14 +291,14 @@
|
| |
mmd.get_context() or models.DEFAULT_MODULE_CONTEXT,
|
| |
])
|
| |
else:
|
| |
- build = models.ModuleBuild.get_build_from_nsvc(
|
| |
+ module_build = models.ModuleBuild.get_build_from_nsvc(
|
| |
self.db_session, name, stream, version, context)
|
| |
- if not build:
|
| |
+ if not module_build:
|
| |
raise UnprocessableEntity(
|
| |
"The module {} was not found".format(
|
| |
":".join([name, stream, version, context]))
|
| |
)
|
| |
- queried_mmd = build.mmd()
|
| |
+ queried_mmd = module_build.mmd()
|
| |
nsvc = ":".join([name, stream, version, context])
|
| |
|
| |
xmd_mbs = queried_mmd.get_xmd().get("mbs", {})
|
| |
@@ -309,6 +310,7 @@
|
| |
|
| |
buildrequires = xmd_mbs["buildrequires"]
|
| |
side_tag = xmd_mbs.get("side_tag")
|
| |
+ side_tag_brs_found = []
|
| |
for br_name, details in buildrequires.items():
|
| |
build = models.ModuleBuild.get_build_from_nsvc(
|
| |
self.db_session,
|
| |
@@ -328,6 +330,7 @@
|
| |
side_tag_format = build.mmd().get_xmd().get("mbs", {}).get("koji_side_tag_format")
|
| |
if side_tag_format:
|
| |
koji_tag = side_tag_format.format(side_tag=side_tag)
|
| |
+ side_tag_brs_found.append(side_tag_format)
|
| |
log.info("Using side tag for base module %s: %s", br_name, koji_tag)
|
| |
else:
|
| |
log.warning("Side tag requested, but base module %s lacks koji_side_tag_format"
|
| |
@@ -340,6 +343,11 @@
|
| |
module_tags.setdefault(koji_tag, [])
|
| |
module_tags[koji_tag].append(build.mmd())
|
| |
|
| |
+ if side_tag and not side_tag_brs_found:
|
| |
+ msg = "None of the buildrequired base modules are configured for side tags."
|
| |
+ if module_build:
|
| |
+ module_build.log_message(self.db_session, msg)
|
| |
+ raise RuntimeError(msg)
|
| |
return module_tags
|
| |
|
| |
def resolve_requires(self, requires):
|
| |