Returns state of the jobs.
State returned as an int based on an enum in the PrunDriver.cxx :
`enum Enum { DONE=0, PENDING=1, FAIL=2 };`
Make sure these values are kept the same in both files.
Extra values are added to capture extra states, those start at 90.
Definition at line 5 of file ELG_jediState.py.
6 """ Returns state of the jobs.
8 State returned as an int based on an enum in the PrunDriver.cxx :
9 `enum Enum { DONE=0, PENDING=1, FAIL=2 };`
10 Make sure these values are kept the same in both files.
11 Extra values are added to capture extra states, those start at 90.
14 from enum
import IntEnum
15 class Status(IntEnum):
25 from pandatools
import PandaToolsPkgInfo
27 print (
"prun needs additional setup, try:")
28 print (
" lsetup panda")
29 return Status.SCRIPT_FAIL
31 jediTaskID =
int(sample.meta().castDouble(
"nc_jediTaskID", 0))
34 print (
"Sample " + sample.name() +
" does not have a jediTaskID")
35 return Status.SCRIPT_FAIL
37 from pandatools
import Client
40 taskDict[
'jediTaskID'] = jediTaskID
41 detail = Client.getJediTaskDetails(taskDict,
False,
True)
43 print (
"Problem checking status of task %s with id %s" % (sample.name(), jediTaskID))
44 return Status.SCRIPT_FAIL
46 status = detail[1][
'status']
48 if status ==
"done":
return Status.DONE
49 elif status ==
"failed":
return Status.FAIL
52 elif status ==
"finished":
return Status.FAIL
53 elif status ==
"running":
return Status.RUNNING