From: Michael Tremer Date: Mon, 6 Jul 2009 15:34:25 +0000 (+0200) Subject: Fixed display of job count & parsing of busy nodes. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1dc1ef43b257f38cf18b78b464fa28721d8f0282;p=ipfire.org.git Fixed display of job count & parsing of busy nodes. Sometimes the was a thing returned like 11/10. --- diff --git a/www/web/cluster.py b/www/web/cluster.py index 03610880..a59b6cd1 100644 --- a/www/web/cluster.py +++ b/www/web/cluster.py @@ -8,7 +8,12 @@ class Node(object): self.address = address self.arch = arch self.speed = speed - self.jobs = jobs + + (jobs_cur, jobs_max) = jobs.split("/") + if jobs_cur > jobs_max: + jobs_cur = jobs_max + self.jobs = "%s/%s" % (jobs_cur, jobs_max) + self.load = int(load) / 10 # in percent def __str__(self): @@ -53,6 +58,7 @@ class Cluster(object): ret = [] data = self.command("listcs") for line in data: + if line.startswith(" "): continue if not line.startswith(" "): continue (a, hostname, address, arch, speed, jobs, load) = line.split(" ") address = address.strip("()")