mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-05-11 18:37:25 +08:00
Merge #1072 Minor fixes to wait handler and KojiModuleBuilder
This commit is contained in:
@@ -178,7 +178,8 @@ class KojiModuleBuilder(GenericBuilder):
|
|||||||
|
|
||||||
# These eventually get populated by calling _connect and __prep is set to True
|
# These eventually get populated by calling _connect and __prep is set to True
|
||||||
self.module_tag = None # string
|
self.module_tag = None # string
|
||||||
self.module_build_tag = None # string
|
# A dict containing tag info returned from Koji API getTag.
|
||||||
|
self.module_build_tag = None
|
||||||
self.module_target = None # A koji target dict
|
self.module_target = None # A koji target dict
|
||||||
|
|
||||||
self.build_priority = config.koji_build_priority
|
self.build_priority = config.koji_build_priority
|
||||||
|
|||||||
@@ -206,9 +206,6 @@ def wait(config, session, msg):
|
|||||||
# This is ok.. it's a race condition we can ignore.
|
# This is ok.. it's a race condition we can ignore.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
tag = None
|
|
||||||
dependencies = []
|
|
||||||
|
|
||||||
resolver = module_build_service.resolver.system_resolver
|
resolver = module_build_service.resolver.system_resolver
|
||||||
|
|
||||||
@module_build_service.utils.retry(
|
@module_build_service.utils.retry(
|
||||||
@@ -226,7 +223,7 @@ def wait(config, session, msg):
|
|||||||
# of the local module build based on Modulemd.Module, because the
|
# of the local module build based on Modulemd.Module, because the
|
||||||
# local build is not stored in the external MBS and therefore we
|
# local build is not stored in the external MBS and therefore we
|
||||||
# cannot query it using the `query` as for Koji below.
|
# cannot query it using the `query` as for Koji below.
|
||||||
dependencies = resolver.get_module_build_dependencies(
|
dep_koji_tags = resolver.get_module_build_dependencies(
|
||||||
mmd=build.mmd(), strict=True).keys()
|
mmd=build.mmd(), strict=True).keys()
|
||||||
|
|
||||||
# We also don't want to get the tag name from the MBS, but just
|
# We also don't want to get the tag name from the MBS, but just
|
||||||
@@ -239,7 +236,7 @@ def wait(config, session, msg):
|
|||||||
log.info("Getting deps for %s" % (nsvc))
|
log.info("Getting deps for %s" % (nsvc))
|
||||||
deps_dict = resolver.get_module_build_dependencies(
|
deps_dict = resolver.get_module_build_dependencies(
|
||||||
build.name, build.stream, build.version, build.context, strict=True)
|
build.name, build.stream, build.version, build.context, strict=True)
|
||||||
dependencies = set(deps_dict.keys())
|
dep_koji_tags = set(deps_dict.keys())
|
||||||
|
|
||||||
# Find out the name of Koji tag to which the module's Content
|
# Find out the name of Koji tag to which the module's Content
|
||||||
# Generator build should be tagged once the build finishes.
|
# Generator build should be tagged once the build finishes.
|
||||||
@@ -254,10 +251,10 @@ def wait(config, session, msg):
|
|||||||
log.info('Getting tag for {0}'.format(nsvc))
|
log.info('Getting tag for {0}'.format(nsvc))
|
||||||
tag = generate_koji_tag(build.name, build.stream, build.version, build.context)
|
tag = generate_koji_tag(build.name, build.stream, build.version, build.context)
|
||||||
|
|
||||||
return dependencies, tag, cg_build_koji_tag
|
return dep_koji_tags, tag, cg_build_koji_tag
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dependencies, tag, cg_build_koji_tag = _get_deps_and_tag()
|
dep_koji_tags, tag, cg_build_koji_tag = _get_deps_and_tag()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
reason = "Failed to get module info from MBS. Max retries reached."
|
reason = "Failed to get module info from MBS. Max retries reached."
|
||||||
log.exception(reason)
|
log.exception(reason)
|
||||||
@@ -280,9 +277,9 @@ def wait(config, session, msg):
|
|||||||
builder = module_build_service.builder.GenericBuilder.create_from_module(
|
builder = module_build_service.builder.GenericBuilder.create_from_module(
|
||||||
session, build, config)
|
session, build, config)
|
||||||
|
|
||||||
log.debug("Adding dependencies %s into buildroot for module %s" % (dependencies, ':'.join(
|
log.debug("Adding dependencies %s into buildroot for module %s" % (dep_koji_tags, ':'.join(
|
||||||
[build.name, build.stream, build.version])))
|
[build.name, build.stream, build.version])))
|
||||||
builder.buildroot_add_repos(dependencies)
|
builder.buildroot_add_repos(dep_koji_tags)
|
||||||
|
|
||||||
if not build.component_builds:
|
if not build.component_builds:
|
||||||
log.info("There are no components in module %r, skipping build" % build)
|
log.info("There are no components in module %r, skipping build" % build)
|
||||||
|
|||||||
Reference in New Issue
Block a user