summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-12-09 12:56:50 +0100
committerHolger Levsen <holger@layer-acht.org>2015-12-09 12:56:50 +0100
commit0f592ece90a3862d8c16bc64146768e326b3ce4d (patch)
treeb194268aa26dd4380bec1124d761a3d14bff7530
parent3c4e35fd8b9d3363052ae9d75120770ee42a8ffb (diff)
downloadjenkins.debian.net-0f592ece90a3862d8c16bc64146768e326b3ce4d.tar.xz
reproducible: dont hardcode the number of build jobs, instead check the actual number on the fs
-rwxr-xr-xbin/reproducible_html_live_status.py11
1 files 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 += '<th>previous build duration</th><th>average build duration</th><th>builder job</th>'
html += '</tr>\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 += '<tr><td colspan="10">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.</td></tr>'
+ if counter > builders:
+ html += '<tr><td colspan="10">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.</td></tr>'
+ elif builders == 0:
+ html += '<tr><td colspan="10">0 build jobs for ' + arch + ' detected. This does not compute, please investigate and fix the cause.</td></tr>'
suite = row[1]
arch = row[2]
pkg = row[3]