AWS Thinkbox Discussion Forums

Use a multiplatform path in Job/Script/Post Task Script

Hi,

I can’t figure out how to make a post task script path working for both Linux and Windows machine. It does not seem to be remapped base on our remapping settings and I tried different ways to type the path relatively to the repository without success. Any suggestion ?

I tried :
//server/deadline/repository/custom/scripts/Tasks/my_script.py
custom/scripts/Tasks/my_script.py
…//custom/scripts/Tasks/my_script.py

Thanks
Chris

Hey,

I think you could solve you problem a couple of ways.

You could either test whether the Linux server location exists, then if not, use the Windows path.

Or

You could test the operating system in your script:

[code]import os

check if windows

if os.name == ‘nt’:
#perform actions on windows \path\here
else:
#perform actions on linux based /path/there[/code]

Let me know how you get on.

Thanks Shaun,

my problem is different, it is not inside Python but inside Deadline, if you check the job properties tab, then Script and Post Task Script you can set here some python script to run. The problem is that if I set a Windows path here, the Linux machine won’t be able to find the script.

Oh, I see.

That is quite a conundrum.

Hopefully the Thinkbox guys will be able to give you a solution later today (it’s only 9:30am in Canada at the moment).

Good luck.

Privacy | Site terms | Cookie preferences