fixed a bug of running jobs not being displayed.
This commit is contained in:
parent
f32c8e0650
commit
0fce823952
@ -26,15 +26,16 @@ class SGETracker(IntervalModule):
|
||||
color = "#ffffff"
|
||||
|
||||
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,
|
||||
shell=True)
|
||||
root = etree.fromstring(xml)
|
||||
jobs = root.xpath('//job_info/job_info/job_list')
|
||||
|
||||
job_dict = {'qw': 0, 'Eqw': 0, 'r': 0}
|
||||
|
||||
for j in root.xpath('//job_info/job_info/job_list'):
|
||||
job_dict[j.find("state").text] += 1
|
||||
|
||||
for j in jobs:
|
||||
for j in root.xpath('//job_info/queue_info/job_list'):
|
||||
job_dict[j.find("state").text] += 1
|
||||
|
||||
return job_dict
|
||||
|
Loading…
Reference in New Issue
Block a user