Hello,
I’m facing an issue where i cannot get tasks for a given job with the python layer inside job events.
I’m running this code throught a OnJobStarted event:
for j in RepositoryUtils.GetJobs(True):
job_tasks = RepositoryUtils.GetJobTasks(j, False)
And i get this error in the job report for the task : Event Error (OnJobStarted): TypeError : No method matches given arguments for GetJobTasks: (<class 'Deadline.Jobs.Job'>)
But i don’t feel like i missed something in the documentation :
Any idea of something i’m missing ?
Thanks !
Deadline version : 10.1.19.4 (d9d0c59e3)
Python 3 enabled.
I’ve tested this on a 10.1.19 setup and from "%deadline_path%"\deadlinecommand -executescript gettasks.py I get correct behaviour and no syntax issues. gettasks.py (254 Bytes)
Copied the same code into an event plugin triggering on OnJobStarted, and I got the same results. The error would make sense if you were calling RepositoryUtils.GetJobTasks(j), as it’s complaining that there’s no method with that name that only takes a Deadline.Jobs.Job object.
I don’t suppose it’s possible you added the boolean in a later iteration and the Worker could be using a cached copy of your script?