From 4f3749adc240604976f5ba295809da656dea1eeb Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Apr 29 2019 13:18:35 +0000 Subject: Make gitbuildhash work for windows builds The requests are structured differently to rpm builds, so we need to look at different field to extract URL. JIRA: COMPOSE-3435 Signed-off-by: Lubomír Sedlář --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 7ad78d1..c12b52b 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -1781,12 +1781,14 @@ class Commands(object): raise rpkgError('Unknown build: %s' % build) # Get the task data out of that build data - taskinfo = self.anon_kojisession.getTaskRequest(bdata['task_id']) - # taskinfo is a list of items, first item is the task url. - # second is the build target. + taskinfo = self.anon_kojisession.getTaskInfo(bdata["task_id"], request=True) + request = taskinfo["request"] + # request is a list of items + # For RPM builds, the first item is the task url. second is the build target. + # For Winbuild tasks the url comes second. # See if the build target starts with cvs or git hash = None - buildsource = taskinfo[0] + buildsource = request[1] if taskinfo["method"] == "winbuild" else request[0] if buildsource.startswith('cvs://'): # snag everything after the last # mark cvstag = buildsource.rsplit('#')[-1]