mirror of
https://gitlab.cs.uni-saarland.de/hpc/cc-condor-sync.git
synced 2024-11-10 02:47:25 +01:00
If no ToE, use eventtime.
This commit is contained in:
parent
35c6ee3b47
commit
253784d94d
@ -9,6 +9,7 @@
|
|||||||
#
|
#
|
||||||
# -- Michael Schwarz <schwarz@uni-paderborn.de>
|
# -- Michael Schwarz <schwarz@uni-paderborn.de>
|
||||||
|
|
||||||
|
from dateutil import parser as dateparser
|
||||||
import platform
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
import json
|
import json
|
||||||
@ -52,7 +53,7 @@ class CCApi:
|
|||||||
return r.json()
|
return r.json()
|
||||||
else:
|
else:
|
||||||
print(data)
|
print(data)
|
||||||
print(r)
|
print(r.status_code, r.content)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def getJobs(self, filter_running=True):
|
def getJobs(self, filter_running=True):
|
||||||
@ -370,9 +371,13 @@ class CondorSync:
|
|||||||
data = {
|
data = {
|
||||||
'jobId': jobId,
|
'jobId': jobId,
|
||||||
'cluster': self.config['cluster'],
|
'cluster': self.config['cluster'],
|
||||||
'stopTime': job['ToE']['When'],
|
|
||||||
'jobState': jobstate
|
'jobState': jobstate
|
||||||
}
|
}
|
||||||
|
if 'ToE' in job:
|
||||||
|
data['stopTime'] = job['ToE']['When']
|
||||||
|
else:
|
||||||
|
data['stopTime'] = int(time.mktime(dateparser.parse(job['EventTime']).timetuple()))
|
||||||
|
|
||||||
if 'JobCurrentStartDate' in job:
|
if 'JobCurrentStartDate' in job:
|
||||||
data['startTime'] = job['JobCurrentStartDate']
|
data['startTime'] = job['JobCurrentStartDate']
|
||||||
|
|
||||||
@ -392,8 +397,7 @@ class CondorSync:
|
|||||||
if event['EventTypeNumber'] == 28: # JobAdInformationEvent
|
if event['EventTypeNumber'] == 28: # JobAdInformationEvent
|
||||||
if event['TriggerEventTypeNumber'] == 1: # Execute
|
if event['TriggerEventTypeNumber'] == 1: # Execute
|
||||||
self._ccStartJob(event)
|
self._ccStartJob(event)
|
||||||
# elif event['TriggerEventTypeNumber'] == 4 or
|
elif event['TriggerEventTypeNumber'] == 4 or event['TriggerEventTypeNumber'] == 5 or \
|
||||||
elif event['TriggerEventTypeNumber'] == 5 or \
|
|
||||||
event['TriggerEventTypeNumber'] == 9 or event['TriggerEventTypeNumber'] == 10 or \
|
event['TriggerEventTypeNumber'] == 9 or event['TriggerEventTypeNumber'] == 10 or \
|
||||||
event['TriggerEventTypeNumber'] == 12:
|
event['TriggerEventTypeNumber'] == 12:
|
||||||
self._ccStopJob(event)
|
self._ccStopJob(event)
|
||||||
|
Loading…
Reference in New Issue
Block a user