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 <kwizart@gmail.com>
This commit is contained in:
Nicolas Chauvet 2023-09-04 21:47:00 +02:00
parent 32901980ba
commit 93a5ca5abe

View file

@ -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 = []