Requeue tasks

I’m struggling here to make a task script to requeue tasks…
I started my script based off of one the original ones

[code]from System.IO import *
from Deadline.Scripting import *
from DeadlineUI.Controls.Scripting.DeadlineScriptDialog import DeadlineScriptDialog

import traceback

def main():

global scriptDialog

# Get the list of selected tasks.
selectedTasks = MonitorUtils.GetSelectedTasks()
oJob =  MonitorUtils.GetSelectedJobs()

RepositoryUtils.RequeueTasks( oJob, selectedTasks)

[/code]

or in the task loop using taskID and JobID
But I think this is the Job ID not the job so it shouldnt like it?


    for task in selectedTasks:
    
        print task.JobID
        print task.TaskID

        RepositoryUtils.RequeueTasks( oJob, selectedTasks)

I want to go from here to get more info, but I’m already a bit stuck on this one!

Out of curiosity, why are you writing a script for this? You seem to be trying to do exactly what the “Requeue Task(s)” command already does… Is there some limitation of our stock Requeue Tasks that you’re trying to get around?

But anyways, from what I can see just by looking at it, this bit would be an issue:

[code] oJob = MonitorUtils.GetSelectedJobs()

RepositoryUtils.RequeueTasks( oJob, selectedTasks)[/code]

GetSelectedJobs() returns an array of Jobs, whereas RequeueTasks() expects a single Job.

So you’d have to do something like this:

[code] selectedJobs = MonitorUtils.GetSelectedJobs()
oJob = selectedJobs[0] #just grab the first one

RepositoryUtils.RequeueTasks( oJob, selectedTasks)

[/code]

Hope this helps!

-Jon

Ah I never thought to check that! Silly me.

The script I am making will be ‘requeue all tasks by this slave’

For the occasions when one machine has had an issue (in the last instance I was short one licene of a plugin so always one machine didn’t render correctly!)

So instead of finding dodgy frame, sort by slave, select tasks, requeue. I want to skip a step or two.

Thanks for your help!

Hey Simon,
This feature is already available in Deadline v6.2. Here’s a snippet from the release notes and a screen-grab of it in action.

“Re-added the task right-click option to requeue all tasks rendered by a specific slave.”

Screen Shot 2014-07-14 at 23.33.55.png

Mike

Oh great! Typical eh. Still on 6.1 clearly :slight_smile: