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

Fixes

parent ca2fb9a3
......@@ -68,17 +68,17 @@ os.umask(0022)
try:
fromMachineAd = open(os.environ['_CONDOR_MACHINE_AD'],'r').read()
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)
try:
fromJobAd = open(os.environ['_CONDOR_JOB_AD'],'r').read()
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)
try:
matchObject = re.search('^GlobalJobId *= *"(.*)"', fromJobAd)
matchObject = re.search('GlobalJobId *= *"(.*)"', fromJobAd)
job_id = matchObject.group(1)
except:
print 'Could not get GlobalJobId from Job Ad'
......@@ -100,7 +100,7 @@ mjfTmpDir = '/tmp'
if 'mjf_tmp_dir=' in fromRun + fromSysconfig:
try:
matchObject = re.search("^mjf_tmp_dir=(.*)", fromRun + '\n' + fromSysconfig)
matchObject = re.search("mjf_tmp_dir=(.*)", fromRun + '\n' + fromSysconfig)
mjfTmpDir = matchObject.group(1)
except:
pass
......@@ -163,7 +163,7 @@ except:
pass
try:
wallMatchObject = re.search('^MaxJobRetirementTime *= *([0-9 +*/()-]*)', fromMachineAd)
wallMatchObject = re.search('MaxJobRetirementTime *= *([0-9 +*/()-]*)', fromMachineAd)
jobfeatures['wall_limit_secs'] = int(eval(wallMatchObject.group(1)))
except:
pass
......@@ -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']
try:
rssMatchObject = re.search('^MemoryProvisioned *= *([0-9 +*/()-]*)', fromJobAd)
rssMatchObject = re.search('MemoryProvisioned *= *([0-9 +*/()-]*)', fromJobAd)
rssInt = int(eval(rssMatchObject.group(1)))
except:
pass
......@@ -183,8 +183,8 @@ else:
jobfeatures['max_rss_bytes'] = rssInt * 1000000
try:
scratchMatchObject = re.search('^DiskProvisioned *= *([0-9 +*/()-]*)', fromJobAd)
scratchInt = int(eval(rssMatchObject.group(1)))
scratchMatchObject = re.search('DiskProvisioned *= *([0-9 +*/()-]*)', fromJobAd)
scratchInt = int(eval(scratchMatchObject.group(1)))
except:
pass
else:
......
Supports Markdown
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