From 82e5fbde5e131f4fa1794e7b8642bca83cd6b818 Mon Sep 17 00:00:00 2001 From: Yu Ming Zhu Date: Nov 04 2021 11:55:50 +0000 Subject: PR#3092: [hub] getBuildType: ensure id exists in buildinfo dict Merges #3092 https://pagure.io/koji/pull-request/3092 Fixes: #3091 https://pagure.io/koji/issue/3091 Cannot get build type for builds in listBuilds --- diff --git a/hub/kojihub.py b/hub/kojihub.py index 56c35f9..4fa69c2 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -4261,7 +4261,7 @@ def get_build(buildInfo, strict=False): """Return information about a build. buildInfo may be either a int ID, a string NVR, or a map containing - 'name', 'version' and 'release. + 'name', 'version' and 'release'. A map will be returned containing the following keys*: id: build ID @@ -4708,7 +4708,7 @@ def get_build_type(buildInfo, strict=False): Returns a dictionary whose keys are type names and whose values are the type info corresponding to that type """ - if not isinstance(buildInfo, dict) or 'extra' not in buildInfo: + if not isinstance(buildInfo, dict) or 'extra' not in buildInfo or 'id' not in buildInfo: binfo = get_build(buildInfo, strict=strict) if not binfo: return None