Dependency Event: Set Child Whitelist to Worker that rendered Parent

Hello,
I’m using the default Houdini to Arnold Standalone workflow that creates a Houdini Job(parent) and a dependent Arnold Standalone(child).
I’m trying to write a “OnJobReleased” event that will set the Child’s whitelisted worker to the worker that rendered the Parent Houdini dependency.

    def OnJobReleased( self, job ):
        self.LogInfo( "Before If Statement Check OnJobReleased" )
        if 'htoa2arnold' in job.JobGroup:
            for dependency in job.JobDependencyIDs:
                jobdep = dependency
                self.LogInfo("Parent/JobDependencyID:" + str(jobdep))
                jobdepname = RepositoryUtils.GetJob(jobdep, True)
                self.LogInfo("Parent/JobDependency Name:" + str(jobdepname))
            #RepositoryUtils.SetMachineLimitListedSlaves(job.JobId,workerparent)
            #RepositoryUtils.SetMachineLimitWhiteListFlag(job.JobId,True)

I’m a bit stumped as to how to get the worker name from the jobID “jobdep”. I can correctly resolve the job ID and the job name. But I’m not sure where to take it from here.
I can set the parent Houdini jobs whilelisted worker to “workerX” with another callback, but I’m not sure how to then get that info from the parent to the Arnold job.
Perhaps there’s a much easier way of doing this as well?

Thanks,
-Jake

To clarify I importing the following:

from __future__ import absolute_import
import os

from Deadline.Events import DeadlineEventListener
from Deadline.Scripting import *
from Deadline.Jobs import *

Shouldn’t this work to grab the parent job’s whitelisted workers?

for dependency in job.JobDependencyIDs:
                parentworker = RepositoryUtils.GetJob(dependency, False).JobListedSlaves