mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-08 13:18:04 +08:00
Merge #501 Stop using .strip('-build')
This commit is contained in:
@@ -223,7 +223,10 @@ class ModuleBuild(MBSBase):
|
||||
|
||||
There should be at most one.
|
||||
"""
|
||||
tag = event.repo_tag.strip('-build')
|
||||
if event.repo_tag.endswith('-build'):
|
||||
tag = event.repo_tag[:-6]
|
||||
else:
|
||||
tag = event.repo_tag
|
||||
query = session.query(cls)\
|
||||
.filter(cls.koji_tag == tag)\
|
||||
.filter(cls.state == BUILD_STATES["build"])
|
||||
@@ -236,7 +239,7 @@ class ModuleBuild(MBSBase):
|
||||
|
||||
@classmethod
|
||||
def from_tag_change_event(cls, session, event):
|
||||
tag = event.tag.strip('-build')
|
||||
tag = event.tag[:-6] if event.tag.endswith('-build') else event.tag
|
||||
query = session.query(cls)\
|
||||
.filter(cls.koji_tag == tag)\
|
||||
.filter(cls.state == BUILD_STATES["build"])
|
||||
|
||||
@@ -41,7 +41,7 @@ def done(config, session, msg):
|
||||
if config.system == "koji" and not tag.endswith('-build'):
|
||||
log.debug("Tag %r does not end with '-build' suffix, ignoring" % tag)
|
||||
return
|
||||
tag = tag.strip('-build')
|
||||
tag = tag[:-6] if tag.endswith('-build') else tag
|
||||
module_build = models.ModuleBuild.from_repo_done_event(session, msg)
|
||||
if not module_build:
|
||||
log.debug("No module build found associated with koji tag %r" % tag)
|
||||
|
||||
Reference in New Issue
Block a user