use listTagged with_owner=False
This commit is contained in:
parent
fc42bb7e71
commit
91aa557391
5 changed files with 10 additions and 9 deletions
|
|
@ -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))
|
||||
builds.extend(session.listTagged(args[0], package=pkg, with_owners=False))
|
||||
elif options.non_latest:
|
||||
if options.force and len(args) == 1:
|
||||
tagged = session.listTagged(args[0])
|
||||
tagged = session.listTagged(args[0], with_owners=False)
|
||||
else:
|
||||
tagged = []
|
||||
for pkg in args[1:]:
|
||||
tagged.extend(session.listTagged(args[0], package=pkg))
|
||||
tagged.extend(session.listTagged(args[0], package=pkg, with_owners=False))
|
||||
# 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))
|
||||
tagged.append(m.listTagged(args[0], package=pkg, with_owners=False))
|
||||
# flatten
|
||||
tagged = list(itertools.chain(*[t.result for t in tagged]))
|
||||
idx = dict([(b['nvr'], b) for b in tagged])
|
||||
|
|
|
|||
|
|
@ -11289,12 +11289,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):
|
||||
owner=None, type=None, with_owners=True):
|
||||
"""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)
|
||||
owner=owner, type=type, with_owners=with_owners)
|
||||
if prefix:
|
||||
prefix = prefix.lower()
|
||||
results = [build for build in results
|
||||
|
|
|
|||
|
|
@ -118,7 +118,8 @@ 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)
|
||||
tagged_list = session.listTagged(tag, event=event, package=build['name'],
|
||||
inherit=True, with_owners=False)
|
||||
for tagged in tagged_list:
|
||||
if tagged['version'] == build['version'] and tagged['release'] == build['release']:
|
||||
break
|
||||
|
|
|
|||
|
|
@ -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)])
|
||||
trash = sorted([(b['nvr'], b) for b in session.listTagged(trashcan_tag, with_owners=False)])
|
||||
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
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ def clean_empty(tags):
|
|||
deleted = []
|
||||
session.multicall = True
|
||||
for tag in tags:
|
||||
session.listTagged(tag['id'])
|
||||
session.listTagged(tag['id'], with_owners=False)
|
||||
for tag, tagged in zip(tags, session.multiCall()):
|
||||
if len(tagged[0]) == 0:
|
||||
candidates.append(tag)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue