Resolve missing OPENPYPE_MONGO in deadline global job preload (#4484)

* replace SpawnProcess with subprocess

* clean up

* replace spawn process with run process

---------

Co-authored-by: Seyedmohammadreza Hashemizadeh <shashemizadeh@ws101.prs.vfx.int>
This commit is contained in:
mre7a 2023-03-15 12:55:50 +01:00 committed by GitHub
parent e927bdaf03
commit 0cb3585d91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -362,11 +362,11 @@ def inject_openpype_environment(deadlinePlugin):
args_str = subprocess.list2cmdline(args)
print(">>> Executing: {} {}".format(exe, args_str))
process = ProcessUtils.SpawnProcess(
exe, args_str, os.path.dirname(exe)
process_exitcode = deadlinePlugin.RunProcess(
exe, args_str, os.path.dirname(exe), -1
)
ProcessUtils.WaitForExit(process, -1)
if process.ExitCode != 0:
if process_exitcode != 0:
raise RuntimeError(
"Failed to run OpenPype process to extract environments."
)