Find "custom" folder location (RCS)

Hello,
We currently have our clients connected to an RCS. I’m using an “OnJobSubmitted” event to do a few things like setting job env vars, etc. I’d like to be able to determine the repository “custom” directory path, but I can’t seem to do so when connected via an RCS. I realize this is probably by design, and the RCS may prevent access to those particular network locations.
I’ve tried using a few different solutions:
RepositoryUtils.GetCustomEventsDirectory()
RepositoryUtils.GetRootDirectory()
self.GetEventDirectory()

Is there another way I could gather this info?
Thanks,
-Jake

Hello @JakeS

Thanks for reaching out, I have tested this having my client connected to RCS, using OnJobSubmitted event and able to get events path that is cached, below is the function added to my script

   def OnJobSubmitted(self, job):
        custom_events_directory = DeadlineScripting.RepositoryUtils.GetCustomEventsDirectory()
        print(custom_events_directory)

Result obtained from OnJobSubmitted event up on submission of Job:

Environment: C:\Users\narru\AppData\Local\Thinkbox\Deadline10\cache\byaBdG5mwhIMLEtvD5F8vA4kTY\events

can you please provide more details about what you are trying to do by your OnJobSubmitted Script, feel free to share the script to understand your end goal!

Thanks.

Hello @Nreddy,
Thanks for your reply. I was trying to route back to the original repo’s “custom” folder location, not the local events cache on the client. However, we have found a workaround to accomplish what we needed. Still, would be good to know if there is a way to find that original repo location if we are connected via an RCS.
-Jake

@JakeS Thanks for an update here, I am glad you were able to find the workaround on the custom folder location. To retrieve the Repository path within the script, you can make use of the “GetRepositoryPath” scripting API. It returns the appropriate full path to the given subdirectory of the Repository.
As an example this would return the worker repository path to the plugins subdirectory:

from Deadline.Scripting import RepositoryUtils, FileUtils, SystemUtils, ClientUtils

def __main__():
    plugin_path = RepositoryUtils.GetRepositoryPath("plugins", False)
    print(plugin_path)

You would need to run the script with deadlinecommand -ExecuteScript

$Deadline_Path\deadlinecommand.exe -ExecuteScript script.py

As you are running RCS, by default it keeps a local cache of the Repository on the client and it may return the cache path of the repository from the client.