From a99f10bb7861a18485ff8468a077f5a940472f3e Mon Sep 17 00:00:00 2001 From: Yu Ming Zhu Date: Jul 17 2020 22:10:33 +0000 Subject: cli: [list-tags] revert server side pattern change fixes: #2379 related: #2320 --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index a144938..7efae36 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -4114,17 +4114,7 @@ def anon_handle_list_tags(goptions, session, args): if not buildinfo: parser.error(_("Invalid build %s" % options.build)) - if not args: - # list everything if no pattern is supplied - args = [None] - - tags = [] - with session.multicall() as m: - for arg in args: - tags.append(m.listTags(build=buildinfo.get('id', None), - package=pkginfo.get('id', None), - pattern=arg)) - tags = list(itertools.chain(*[t.result for t in tags])) + tags = session.listTags(buildinfo.get('id', None), pkginfo.get('id', None)) tags.sort(key=lambda x: x['name']) # if options.verbose: # fmt = "%(name)s [%(id)i] %(perm)s %(locked)s %(arches)s" @@ -4133,6 +4123,12 @@ def anon_handle_list_tags(goptions, session, args): else: fmt = "%(name)s" for tag in tags: + if args: + for pattern in args: + if fnmatch.fnmatch(tag['name'], pattern): + break + else: + continue if options.unlocked: if tag['locked'] or tag['perm']: continue