job_id = "some_job_id"
bad_slave = "a_very_naughty_slave"
is_white_list = False
# Set Job's Machine List to a black list
RepositoryUtils.SetMachineLimitWhiteListFlag( job_id, is_white_list )
# Adds the new bad slave.
RepositoryUtils.AddSlavesToMachineLimitList( job_id, bad_slave )
Note: A different way to accomplish is by directly modifying the Job object that you have, but you’ll need to save it back to the Database after making your changes.
That’s entirely up to you, what are you trying to accomplish with programmatically blacklisting a Slave (in this case, the Slave on task 0)? Is your example what you’re planning on doing?
We sometimes have artists machines go on the the farm and the don’t have the correct versions of software installed, so I want to adjust the Houdini plugin, to scan for the line "Error starting “C:\Program Files\Side Effects Software.*” and then blacklist the slave that produced it
It should be pretty straight forward using your code. Thank you!
The gist of it here, is that if you can create groups for the applicable Houdini versions, and assign them (on submission) to the jobs. This way, artist machines that don’t have the right version for the job won’t attempt to render it by accident.
Yeah, cool that largely works. Except in cases when a machine was powered off when we updated the farm/workstations with software - then we end up with one or two rogue machines that haven’t got the right version.
This attempt to blacklist a slave using the code is my little fail-safe idea