Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed capturing exception

  • Loading branch information...
commit 8641ffb810025f37fcadf2adccd706e2cc8b0672 1 parent 280a262
Filip Krikava authored
Showing with 15 additions and 9 deletions.
  1. +15 −9 plugins/dstat_condor_queue.py
View
24 plugins/dstat_condor_queue.py
@@ -114,15 +114,21 @@ def check(self):
def extract(self):
last_line = None
- for last_line in cmd_readlines(self.condor_status_cmd):
- pass
- m = CONDOR_Q_STAT_PATTER.match(last_line)
- if m == None:
- raise Exception, 'Invalid output from %s. Got: %s' % (cmd, last_line)
-
- stats = [int(s.strip()) for s in m.groups()]
- for i,j in enumerate(self.vars):
- self.val[j] = stats[i]
+ try:
+ for repeats in range(3):
+ for last_line in cmd_readlines(self.condor_status_cmd):
+ pass
+
+ m = CONDOR_Q_STAT_PATTER.match(last_line)
+ if m == None:
+ raise Exception, 'Invalid output from %s. Got: %s' % (cmd, last_line)
+
+ stats = [int(s.strip()) for s in m.groups()]
+ for i,j in enumerate(self.vars):
+ self.val[j] = stats[i]
+ except Exception:
+ for name in self.vars:
+ self.val[name] = -1
# vim:ts=4:sw=4:et

0 comments on commit 8641ffb

Please sign in to comment.
Something went wrong with that request. Please try again.