Little bugfix, there might be failed jobs without a step

This commit is contained in:
Michael Schwarz 2022-08-30 11:00:04 +02:00
parent 483bc0da1d
commit 631ed6c8b6

View File

@ -310,7 +310,7 @@ class SlurmSync:
else:
jobsAcctData = self._getAccDataForJob(jobid)['jobs']
for j in jobsAcctData:
if j['steps'][0]['time']['start'] == ccjob['startTime']:
if len(j['steps']) > 0 and j['steps'][0]['time']['start'] == ccjob['startTime']:
jobAcctData = j
jobstate = jobAcctData['state']['current'].lower()
endtime = jobAcctData['time']['end']