From d87cdc46bed187e6bfc00c64d8b2516c05375be3 Mon Sep 17 00:00:00 2001 From: James Molet Date: Jun 04 2019 12:47:05 +0000 Subject: Allow taginfo cli to use tag IDs; fixed bug where Inheritance always used the last tag when querying for multiple tags. Tries string before ID in taginfo --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 018428a..a05e53c 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -4759,8 +4759,13 @@ def anon_handle_taginfo(goptions, session, args): for tag in args: info = session.getTag(tag, **event_opts) if info is None: - print("No such tag: %s" % tag) - sys.exit(1) + try: + info = session.getTag(int(tag), **event_opts) + except ValueError: + info = None + if info is None: + print("No such tag: %s" % tag) + sys.exit(1) tags.append(info) for n, info in enumerate(tags): @@ -4814,7 +4819,7 @@ def anon_handle_taginfo(goptions, session, args): for rinfo in external_repos: print(" %(priority)3i %(external_repo_name)s (%(url)s)" % rinfo) print("Inheritance:") - for parent in session.getInheritanceData(tag, **event_opts): + for parent in session.getInheritanceData(info['id'], **event_opts): flags = '' for code,expr in ( ('M',parent['maxdepth'] is not None),