From a14a1fee39de8482e06717c68a4cc352fcc7d710 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Sep 30 2020 08:43:19 +0000 Subject: fix for older hub --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 8a0b887..242edd6 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -7660,4 +7660,9 @@ def handle_version(goptions, session, args): """Report client and hub versions""" ensure_connection(session) print('Client: %s' % koji.__version__) - print('Hub: %s' % session.getKojiVersion()) + try: + version = session.getKojiVersion() + print("Hub: %s" % version) + except koji.GenericError: + print("Hub: Can' determine (older than 1.23)") + diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py index 5312e50..00fafd3 100644 --- a/www/kojiweb/index.py +++ b/www/kojiweb/index.py @@ -2485,7 +2485,10 @@ def api(environ): server = _getServer(environ) values['methods'] = sorted(server._listapi(), key=lambda x: x['name']) - values['koji_version'] = server.getKojiVersion() + try: + values['koji_version'] = server.getKojiVersion() + except koji.GenericError: + values['koji_version'] = "Can't determine (older then 1.23)" return _genHTML(environ, 'api.chtml')