diff --git a/i3pystatus/sge.py b/i3pystatus/sge.py index 578a6bd..989558f 100644 --- a/i3pystatus/sge.py +++ b/i3pystatus/sge.py @@ -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