AWS Thinkbox Discussion Forums

Pause Job on Failure of PreJobscript

Hey guys,
Just wondering if it’s possible to halt a job from running if the Prejobscript fails. We need to ensure that some job scripts are run before frames start picking upr. Is there currently any way to do this?
Thanks!
-Shem

Is the failure something you can detect in a try/except block in your pre job script? If so, you should just be able to call RepositoryUtils.SuspendJob( job ), where “job” is the job object.

Cheers,
Ryan

Awesome, that’s exactly what I was looking for.
Thanks!

Oh, I think that this is a pretty trivial question, but I’ve been trying to code a PreTask script.
From your docs, it looks like GetCurrentTaskId is a global function within Deadline.Scripting.
However, when I try importing everything within Deadline.Scripting, it can’t seem to find this method. What’s the intended usage for this method?
For example, this is how I’m trying to see if it even exists:

from Deadline.Scripting import *
task_id = GetCurrentTaskId()
print task_id

Hey Shem,

The online documentation actually needs to be updated here, since global functions were removed in Deadline 6. If you download the 6.1 documentation (viewtopic.php?f=85&t=10933), you’ll find that this section has been updated.

The main function for the script accepts an instance of the DeadlinePlugin object, which you can call this function from. For example:

from Deadline.Scripting import *

def __main__( deadlinePlugin ):
    task_id = deadlinePlugin.GetCurrentTaskId()
    print task_id

You can find all the other functions for the DeadlinePlugin object in our Scripting documentation, which is also available from the link above.

Cheers,
Ryan

Awesome. Thanks for the great support!

Privacy | Site terms | Cookie preferences