PR#2038: Don't use listTagged(tag, *) for untag-build
Merges #2038 https://pagure.io/koji/pull-request/2038 Fixes: #2037 https://pagure.io/koji/issue/2037 untag-build hangs indefinitely
This commit is contained in:
commit
ef0730f5d5
1 changed files with 11 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ from __future__ import absolute_import, division
|
|||
import ast
|
||||
import fnmatch
|
||||
import hashlib
|
||||
import itertools
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
|
|
@ -6709,8 +6710,17 @@ def handle_untag_build(goptions, session, args):
|
|||
builds.append(binfo)
|
||||
seen_pkg[binfo['name']] = 1
|
||||
else:
|
||||
tagged = session.listTagged(args[0])
|
||||
# find all pkg's builds in tag
|
||||
pkgs = set([koji.parse_NVR(nvr)['name'] for nvr in args[1:]])
|
||||
tagged = []
|
||||
with session.multicall() as m:
|
||||
for pkg in pkgs:
|
||||
tagged.append(m.listTagged(args[0], package=pkg))
|
||||
# flatten
|
||||
tagged = list(itertools.chain(*[t.result for t in tagged]))
|
||||
idx = dict([(b['nvr'], b) for b in tagged])
|
||||
|
||||
# check exact builds
|
||||
builds = []
|
||||
for nvr in args[1:]:
|
||||
binfo = idx.get(nvr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue