From 0f592ece90a3862d8c16bc64146768e326b3ce4d Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 9 Dec 2015 12:56:50 +0100 Subject: reproducible: dont hardcode the number of build jobs, instead check the actual number on the fs --- bin/reproducible_html_live_status.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/reproducible_html_live_status.py b/bin/reproducible_html_live_status.py index 2f044c67..00eb8e26 100755 --- a/bin/reproducible_html_live_status.py +++ b/bin/reproducible_html_live_status.py @@ -10,7 +10,7 @@ from reproducible_common import * from reproducible_html_indexes import build_leading_text_section - +import glob def generate_schedule(arch): """ the schedule pages are very different than others index pages """ @@ -64,11 +64,14 @@ def generate_live_status_table(arch): html += 'previous build durationaverage build durationbuilder job' html += '\n' counter = 0 + # the path should probably not be hard coded hereā€¦ + builders = len(glob.glob('/var/lib/jenkins/jobs/reproducible_builder_' + arch + '_*')) for row in rows: counter += 1 - # FIXME: the numbers 32 and 15 should really be derived from /var/lib/jenkins/jobs/reproducible_builder_${arch}_* instead of being hard-coded here... - if ( arch == 'amd64' and counter > 32 ) or ( arch == 'armhf' and counter > 15 ): - html += 'There are more builds marked as currently building in the database than there are ' + arch + ' build jobs. This does not compute, please investigate and fix the cause.' + if counter > builders: + html += 'There are more builds marked as currently building in the database (' + counter + ') than there are ' + arch + ' build jobs (' + builders + '). This does not compute, please investigate and fix the cause.' + elif builders == 0: + html += '0 build jobs for ' + arch + ' detected. This does not compute, please investigate and fix the cause.' suite = row[1] arch = row[2] pkg = row[3] -- cgit v1.2.3-70-g09d2