lib: return taskLabel for unknown tasks

"malformed task" has been returned for everything unknown, but external
plugins can create completely valid tasks which we can't parse without
those plugins. In such case we want to return at least method/arch info.

Related: https://pagure.io/koji/issue/2904
This commit is contained in:
Tomas Kopecek 2021-06-09 14:44:04 +02:00
parent ef39e057a9
commit d53c3f88fa

View file

@ -3363,7 +3363,14 @@ def _taskLabel(taskInfo):
method = taskInfo['method']
request = taskInfo['request']
arch = taskInfo['arch']
params = parse_task_params(method, request)
try:
params = parse_task_params(method, request)
except TypeError:
# for external hub plugins which are not known
# at this place (e.g. client without knowledge of such signatures)
# it should still display at least "method (arch)"
params = None
extra = ''
if method in ('build', 'maven'):
src = params.get('src') or params.get('url')