Skip to content
This repository was archived by the owner on Oct 10, 2019. It is now read-only.

Commit e4dbcd4

Browse files
committed
Merge branch 'v1_18_bosco' into sw2929_fix_mem_parsing
2 parents aa755f0 + af091f9 commit e4dbcd4

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/scripts/blah.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Common functions for BLAH python scripts"""
22

3-
import os
43
from ConfigParser import RawConfigParser
5-
from io import StringIO
4+
# TODO: io.StringIO is preferred in Python3 since it handles unicode-encoded files
5+
from StringIO import StringIO
66

77
class BlahConfigParser(RawConfigParser, object):
88

@@ -12,7 +12,7 @@ def __init__(self, path='/etc/blah.config', defaults=None):
1212
self.header = 'blahp'
1313
with open(path) as f:
1414
config = f.read()
15-
vfile = StringIO(u'[%s]\n%s' % (self.header, config))
15+
vfile = StringIO('[%s]\n%s' % (self.header, config))
1616

1717
super(BlahConfigParser, self).__init__(defaults=defaults)
1818
# TODO: readfp() is replaced by read_file() in Python 3.2+

src/scripts/pbs_status.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import subprocess
4141
import signal
4242
import tempfile
43+
import traceback
4344
import pickle
4445
import csv
4546

@@ -587,5 +588,6 @@ def main():
587588
except SystemExit:
588589
raise
589590
except Exception, e:
591+
log(traceback.format_exc())
590592
print "1ERROR: %s" % str(e).replace("\n", "\\n")
591593
sys.exit(0)

src/scripts/slurm_status.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import subprocess
4141
import signal
4242
import tempfile
43+
import traceback
4344
import pickle
4445
import csv
4546

@@ -555,5 +556,6 @@ def main():
555556
except SystemExit:
556557
raise
557558
except Exception, e:
559+
log(traceback.format_exc())
558560
print "1ERROR: %s" % str(e).replace("\n", "\\n")
559561
sys.exit(0)

0 commit comments

Comments
 (0)