From 93a5ca5abe0e4d36b1e975f04978e9dfe430e37e Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Mon, 4 Sep 2023 21:47:00 +0200 Subject: [PATCH] cli: handle hub w/o getKojiVersion in cancel tasks Cancel tasks are used from newer fedora koji client on some hubs that are lacking any getKojiVersion method, so assumes older_hub = True Signed-off-by: Nicolas Chauvet --- cli/koji_cli/commands.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 650761f3..28d4418a 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -6213,9 +6213,12 @@ def handle_cancel(goptions, session, args): parser.error("You must specify at least one task id or build") activate_session(session, goptions) older_hub = False - hub_version = session.getKojiVersion() - v = tuple([int(x) for x in hub_version.split('.')]) - if v < (1, 33, 0): + try: + hub_version = session.getKojiVersion() + v = tuple([int(x) for x in hub_version.split('.')]) + if v < (1, 33, 0): + older_hub = True + except koji.GenericError: older_hub = True tlist = [] blist = []