cleanup removed options

This commit is contained in:
Tomas Kopecek 2021-04-12 09:26:38 +02:00
parent 02ea2901e2
commit 3fed02c8ad
5 changed files with 10 additions and 12 deletions

View file

@ -6760,14 +6760,14 @@ def handle_untag_build(goptions, session, args):
if options.all:
builds = []
for pkg in args[1:]:
builds.extend(session.listTagged(args[0], package=pkg, with_owners=False))
builds.extend(session.listTagged(args[0], package=pkg))
elif options.non_latest:
if options.force and len(args) == 1:
tagged = session.listTagged(args[0], with_owners=False)
tagged = session.listTagged(args[0])
else:
tagged = []
for pkg in args[1:]:
tagged.extend(session.listTagged(args[0], package=pkg, with_owners=False))
tagged.extend(session.listTagged(args[0], package=pkg))
# listTagged orders entries latest first
seen_pkg = {}
builds = []
@ -6785,7 +6785,7 @@ def handle_untag_build(goptions, session, args):
tagged = []
with session.multicall() as m:
for pkg in pkgs:
tagged.append(m.listTagged(args[0], package=pkg, with_owners=False))
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])

View file

@ -2580,8 +2580,7 @@ def repo_init(tag, task_id=None, with_src=False, with_debuginfo=False, event=Non
latest = not tinfo['extra'].get('repo_include_all', False)
# Note: the repo_include_all option is not recommended for common use
# see https://pagure.io/koji/issue/588 for background
rpms, builds = readTaggedRPMS(tag_id, event=event_id, inherit=True, latest=latest,
with_owners=False)
rpms, builds = readTaggedRPMS(tag_id, event=event_id, inherit=True, latest=latest)
groups = readTagGroups(tag_id, event=event_id, inherit=True)
blocks = [pkg for pkg in readPackageList(tag_id, event=event_id, inherit=True,
with_owners=False).values()
@ -11292,12 +11291,12 @@ class RootExports(object):
task.setPriority(priority, recurse=recurse)
def listTagged(self, tag, event=None, inherit=False, prefix=None, latest=False, package=None,
owner=None, type=None, with_owners=True):
owner=None, type=None):
"""List builds tagged with tag"""
# lookup tag id
tag = get_tag(tag, strict=True, event=event)['id']
results = readTaggedBuilds(tag, event, inherit=inherit, latest=latest, package=package,
owner=owner, type=type, with_owners=with_owners)
owner=owner, type=type)
if prefix:
prefix = prefix.lower()
results = [build for build in results

View file

@ -118,8 +118,7 @@ def checkForBuilds(session, tag, builds, event, latest=False):
if latest:
tagged_list = session.getLatestBuilds(tag, event=event, package=build['name'])
else:
tagged_list = session.listTagged(tag, event=event, package=build['name'],
inherit=True, with_owners=False)
tagged_list = session.listTagged(tag, event=event, package=build['name'], inherit=True)
for tagged in tagged_list:
if tagged['version'] == build['version'] and tagged['release'] == build['release']:
break

View file

@ -626,7 +626,7 @@ def handle_delete(just_salvage=False):
"""
print("Getting list of builds in trash...")
trashcan_tag = options.trashcan_tag
trash = sorted([(b['nvr'], b) for b in session.listTagged(trashcan_tag, with_owners=False)])
trash = sorted([(b['nvr'], b) for b in session.listTagged(trashcan_tag)])
print("...got %i builds" % len(trash))
# XXX - it would be better if there were more appropriate server calls for this
grace_period = options.grace_period

View file

@ -188,7 +188,7 @@ def clean_empty(tags):
deleted = []
session.multicall = True
for tag in tags:
session.listTagged(tag['id'], with_owners=False)
session.listTagged(tag['id'])
for tag, tagged in zip(tags, session.multiCall()):
if len(tagged[0]) == 0:
candidates.append(tag)