From 9b748f752e017c4de7fcf930fa04d8db8d8665c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 22 Feb 2016 09:36:41 +0100 Subject: [PATCH] [koji-wrapper] Fix getting results from spin-appliance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also don't create new client proxy when one already exists. Signed-off-by: Lubomír Sedlář --- pungi/wrappers/kojiwrapper.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pungi/wrappers/kojiwrapper.py b/pungi/wrappers/kojiwrapper.py index 8d44d8af..c1a30f6f 100644 --- a/pungi/wrappers/kojiwrapper.py +++ b/pungi/wrappers/kojiwrapper.py @@ -268,7 +268,7 @@ class KojiWrapper(object): children_tasks = self.koji_proxy.getTaskChildren(task_id, request=True) for child_task in children_tasks: - if child_task['method'] not in ['createImage', 'createLiveMedia']: + if child_task['method'] not in ['createImage', 'createLiveMedia', 'createAppliance']: continue is_scratch = child_task['request'][-1].get('scratch', False) @@ -294,10 +294,9 @@ class KojiWrapper(object): def get_image_path(self, task_id): result = [] - koji_proxy = self.koji_module.ClientSession(self.koji_module.config.server) task_info_list = [] - task_info_list.append(koji_proxy.getTaskInfo(task_id, request=True)) - task_info_list.extend(koji_proxy.getTaskChildren(task_id, request=True)) + task_info_list.append(self.koji_proxy.getTaskInfo(task_id, request=True)) + task_info_list.extend(self.koji_proxy.getTaskChildren(task_id, request=True)) # scan parent and child tasks for certain methods task_info = None @@ -307,13 +306,13 @@ class KojiWrapper(object): break scratch = task_info["request"][-1].get("scratch", False) - task_result = koji_proxy.getTaskResult(task_info["id"]) + task_result = self.koji_proxy.getTaskResult(task_info["id"]) task_result.pop("rpmlist", None) if scratch: topdir = os.path.join(self.koji_module.pathinfo.work(), self.koji_module.pathinfo.taskrelpath(task_info["id"])) else: - build = koji_proxy.getImageBuild("%(name)s-%(version)s-%(release)s" % task_result) + build = self.koji_proxy.getImageBuild("%(name)s-%(version)s-%(release)s" % task_result) build["name"] = task_result["name"] build["version"] = task_result["version"] build["release"] = task_result["release"]