Commit da490741 authored by Andrew McNab's avatar Andrew McNab
Browse files

Fixes

parent ca2fb9a3
...@@ -68,17 +68,17 @@ os.umask(0022) ...@@ -68,17 +68,17 @@ os.umask(0022)
try: try:
fromMachineAd = open(os.environ['_CONDOR_MACHINE_AD'],'r').read() fromMachineAd = open(os.environ['_CONDOR_MACHINE_AD'],'r').read()
except: except:
sys.stderr.write('Could not read $_CONDOR_MACHINE_AD file - exiting htcondor-jobfeatures') sys.stderr.write('Could not read $_CONDOR_MACHINE_AD file - exiting htcondor-jobfeatures\n')
sys.exit(10) sys.exit(10)
try: try:
fromJobAd = open(os.environ['_CONDOR_JOB_AD'],'r').read() fromJobAd = open(os.environ['_CONDOR_JOB_AD'],'r').read()
except: except:
sys.stderr.write('Could not read $_CONDOR_JOB_AD file - exiting htcondor-jobfeatures') sys.stderr.write('Could not read $_CONDOR_JOB_AD file - exiting htcondor-jobfeatures\n')
sys.exit(10) sys.exit(10)
try: try:
matchObject = re.search('^GlobalJobId *= *"(.*)"', fromJobAd) matchObject = re.search('GlobalJobId *= *"(.*)"', fromJobAd)
job_id = matchObject.group(1) job_id = matchObject.group(1)
except: except:
print 'Could not get GlobalJobId from Job Ad' print 'Could not get GlobalJobId from Job Ad'
...@@ -100,7 +100,7 @@ mjfTmpDir = '/tmp' ...@@ -100,7 +100,7 @@ mjfTmpDir = '/tmp'
if 'mjf_tmp_dir=' in fromRun + fromSysconfig: if 'mjf_tmp_dir=' in fromRun + fromSysconfig:
try: try:
matchObject = re.search("^mjf_tmp_dir=(.*)", fromRun + '\n' + fromSysconfig) matchObject = re.search("mjf_tmp_dir=(.*)", fromRun + '\n' + fromSysconfig)
mjfTmpDir = matchObject.group(1) mjfTmpDir = matchObject.group(1)
except: except:
pass pass
...@@ -163,7 +163,7 @@ except: ...@@ -163,7 +163,7 @@ except:
pass pass
try: try:
wallMatchObject = re.search('^MaxJobRetirementTime *= *([0-9 +*/()-]*)', fromMachineAd) wallMatchObject = re.search('MaxJobRetirementTime *= *([0-9 +*/()-]*)', fromMachineAd)
jobfeatures['wall_limit_secs'] = int(eval(wallMatchObject.group(1))) jobfeatures['wall_limit_secs'] = int(eval(wallMatchObject.group(1)))
except: except:
pass pass
...@@ -174,7 +174,7 @@ if not 'cpu_limit_secs' in jobfeatures and 'wall_limit_secs' in jobfeatures: ...@@ -174,7 +174,7 @@ if not 'cpu_limit_secs' in jobfeatures and 'wall_limit_secs' in jobfeatures:
jobfeatures['cpu_limit_secs'] = jobfeatures['wall_limit_secs'] * jobfeatures['allocated_cpu'] jobfeatures['cpu_limit_secs'] = jobfeatures['wall_limit_secs'] * jobfeatures['allocated_cpu']
try: try:
rssMatchObject = re.search('^MemoryProvisioned *= *([0-9 +*/()-]*)', fromJobAd) rssMatchObject = re.search('MemoryProvisioned *= *([0-9 +*/()-]*)', fromJobAd)
rssInt = int(eval(rssMatchObject.group(1))) rssInt = int(eval(rssMatchObject.group(1)))
except: except:
pass pass
...@@ -183,8 +183,8 @@ else: ...@@ -183,8 +183,8 @@ else:
jobfeatures['max_rss_bytes'] = rssInt * 1000000 jobfeatures['max_rss_bytes'] = rssInt * 1000000
try: try:
scratchMatchObject = re.search('^DiskProvisioned *= *([0-9 +*/()-]*)', fromJobAd) scratchMatchObject = re.search('DiskProvisioned *= *([0-9 +*/()-]*)', fromJobAd)
scratchInt = int(eval(rssMatchObject.group(1))) scratchInt = int(eval(scratchMatchObject.group(1)))
except: except:
pass pass
else: else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment