From c05282be44e8806594b9b20e982e02d4441ab12b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 11 Aug 2016 08:30:51 +0200 Subject: [PATCH] [osbs] Convert build_id to int MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The getBuild API call expects either an integer or string NVR, otherwise it will crash. Signed-off-by: Lubomír Sedlář --- pungi/phases/osbs.py | 2 +- tests/test_osbs_phase.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pungi/phases/osbs.py b/pungi/phases/osbs.py index 6ddbfefe..c0626784 100644 --- a/pungi/phases/osbs.py +++ b/pungi/phases/osbs.py @@ -89,7 +89,7 @@ class OSBSThread(WorkerThread): def _add_metadata(self, koji_proxy, variant, task_id): # Create metadata result = koji_proxy.getTaskResult(task_id) - build_id = result['koji_builds'][0] + build_id = int(result['koji_builds'][0]) buildinfo = koji_proxy.getBuild(build_id) archives = koji_proxy.listArchives(build_id) diff --git a/tests/test_osbs_phase.py b/tests/test_osbs_phase.py index 0b719bcf..917278d9 100755 --- a/tests/test_osbs_phase.py +++ b/tests/test_osbs_phase.py @@ -209,8 +209,8 @@ class OSBSThreadTest(helpers.PungiTestCase): mock.call.watch_task( 12345, self.topdir + '/logs/global/osbs/Server-1-watch-task.log'), mock.call.koji_proxy.getTaskResult(12345), - mock.call.koji_proxy.getBuild('54321'), - mock.call.koji_proxy.listArchives('54321')]) + mock.call.koji_proxy.getBuild(54321), + mock.call.koji_proxy.listArchives(54321)]) def _assertRepoFile(self): with open(self.topdir + '/work/global/tmp-Server/compose-rpms-1.repo') as f: