fixed a bug of running jobs not being displayed.

This commit is contained in:
Jan Oliver Oelerich 2016-01-20 09:09:32 +01:00
parent f32c8e0650
commit 0fce823952

View File

@ -26,15 +26,16 @@ class SGETracker(IntervalModule):
color = "#ffffff" color = "#ffffff"
def parse_qstat_xml(self): def parse_qstat_xml(self):
xml = subprocess.check_output("ssh {0} \"qstat -f -xml\"".format(self.ssh), xml = subprocess.check_output("ssh {0} \"qstat -xml\"".format(self.ssh),
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
shell=True) shell=True)
root = etree.fromstring(xml) root = etree.fromstring(xml)
jobs = root.xpath('//job_info/job_info/job_list')
job_dict = {'qw': 0, 'Eqw': 0, 'r': 0} job_dict = {'qw': 0, 'Eqw': 0, 'r': 0}
for j in jobs: for j in root.xpath('//job_info/job_info/job_list'):
job_dict[j.find("state").text] += 1
for j in root.xpath('//job_info/queue_info/job_list'):
job_dict[j.find("state").text] += 1 job_dict[j.find("state").text] += 1
return job_dict return job_dict