From: Vyacheslav Linnik Date: Fri, 22 Nov 2013 04:21:54 +0000 (+0400) Subject: Jobs without the first build can throw error X-Git-Tag: v0.2.23~61^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b039047f13b3cf82f785a29decc0d54d72cb2378;p=tools%2Fpython-jenkinsapi.git Jobs without the first build can throw error --- diff --git a/jenkinsapi/job.py b/jenkinsapi/job.py index 29c1b70..d5e1b69 100644 --- a/jenkinsapi/job.py +++ b/jenkinsapi/job.py @@ -87,7 +87,7 @@ class Job(JenkinsBase, MutableJenkinsThing): Jenkins API loads the first 100 builds and thus may not contain all builds information. This method checks if all builds are loaded in the data object and updates it with the missing builds if needed.''' - if not data.get("builds"): + if not (data.get("builds") and data.get("firstBuild")): return data # do not call _buildid_for_type here: it would poll and do an infinite loop oldest_loaded_build_number = data["builds"][-1]["number"]