From b1c23244024f4e101937118f3e0d4bcf02ec6758 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 15 Apr 2024 22:34:43 +0200 Subject: [PATCH 1/4] use getenv to get the value of an env variable --- openpype/modules/deadline/plugins/publish/submit_publish_job.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/modules/deadline/plugins/publish/submit_publish_job.py b/openpype/modules/deadline/plugins/publish/submit_publish_job.py index ae951cacec9..8b40f5ea911 100644 --- a/openpype/modules/deadline/plugins/publish/submit_publish_job.py +++ b/openpype/modules/deadline/plugins/publish/submit_publish_job.py @@ -187,7 +187,7 @@ def _submit_deadline_post_job(self, instance, job, instances): create_metadata_path(instance, anatomy) environment = { - "AVALON_DB": os.environ["AVALON_DB"], + "AVALON_DB": os.getenv("AVALON_DB"), "AVALON_PROJECT": instance.context.data["projectName"], "AVALON_ASSET": instance.context.data["asset"], "AVALON_TASK": instance.context.data["task"], From b5633afffabe5e2a8143e5a80371db2217c73683 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 16 Apr 2024 10:00:53 +0200 Subject: [PATCH 2/4] move line to a proper place --- openpype/modules/deadline/plugins/publish/submit_publish_job.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/modules/deadline/plugins/publish/submit_publish_job.py b/openpype/modules/deadline/plugins/publish/submit_publish_job.py index 8b40f5ea911..06166a68ace 100644 --- a/openpype/modules/deadline/plugins/publish/submit_publish_job.py +++ b/openpype/modules/deadline/plugins/publish/submit_publish_job.py @@ -187,7 +187,6 @@ def _submit_deadline_post_job(self, instance, job, instances): create_metadata_path(instance, anatomy) environment = { - "AVALON_DB": os.getenv("AVALON_DB"), "AVALON_PROJECT": instance.context.data["projectName"], "AVALON_ASSET": instance.context.data["asset"], "AVALON_TASK": instance.context.data["task"], @@ -203,6 +202,7 @@ def _submit_deadline_post_job(self, instance, job, instances): environment["AYON_BUNDLE_NAME"] = os.environ["AYON_BUNDLE_NAME"] deadline_plugin = "Ayon" else: + environment["AVALON_DB"] = os.getenv("AVALON_DB") environment["OPENPYPE_PUBLISH_JOB"] = "1" environment["OPENPYPE_RENDER_JOB"] = "0" environment["OPENPYPE_REMOTE_PUBLISH"] = "0" From 391ddbbf45d9ceafa020ab11ff4cc257bcf675ab Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Tue, 16 Apr 2024 10:14:33 +0200 Subject: [PATCH 3/4] use os.environ instead of getenv Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- openpype/modules/deadline/plugins/publish/submit_publish_job.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/modules/deadline/plugins/publish/submit_publish_job.py b/openpype/modules/deadline/plugins/publish/submit_publish_job.py index 06166a68ace..1fe678616aa 100644 --- a/openpype/modules/deadline/plugins/publish/submit_publish_job.py +++ b/openpype/modules/deadline/plugins/publish/submit_publish_job.py @@ -202,7 +202,7 @@ def _submit_deadline_post_job(self, instance, job, instances): environment["AYON_BUNDLE_NAME"] = os.environ["AYON_BUNDLE_NAME"] deadline_plugin = "Ayon" else: - environment["AVALON_DB"] = os.getenv("AVALON_DB") + environment["AVALON_DB"] = os.environ["AVALON_DB"] environment["OPENPYPE_PUBLISH_JOB"] = "1" environment["OPENPYPE_RENDER_JOB"] = "0" environment["OPENPYPE_REMOTE_PUBLISH"] = "0" From 8b31020a767f0567cf4d18392dbddd6078702300 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Tue, 16 Apr 2024 10:30:31 +0200 Subject: [PATCH 4/4] fix 2 more places --- .../plugins/publish/submit_maya_remote_publish_deadline.py | 2 +- .../deadline/plugins/publish/submit_publish_cache_job.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py b/openpype/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py index a9fb10de8b3..01398576ada 100644 --- a/openpype/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py +++ b/openpype/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py @@ -108,7 +108,6 @@ def get_job_info(self): if key in os.environ}, **legacy_io.Session) # TODO replace legacy_io with context.data - environment["AVALON_DB"] = os.environ.get("AVALON_DB") environment["AVALON_PROJECT"] = project_name environment["AVALON_ASSET"] = instance.context.data["asset"] environment["AVALON_TASK"] = instance.context.data["task"] @@ -122,6 +121,7 @@ def get_job_info(self): environment["AYON_REMOTE_PUBLISH"] = "1" else: environment["OPENPYPE_REMOTE_PUBLISH"] = "1" + environment["AVALON_DB"] = os.environ.get("AVALON_DB") for key, value in environment.items(): job_info.EnvironmentKeyValue[key] = value diff --git a/openpype/modules/deadline/plugins/publish/submit_publish_cache_job.py b/openpype/modules/deadline/plugins/publish/submit_publish_cache_job.py index 434a823cfe6..6f826e85671 100644 --- a/openpype/modules/deadline/plugins/publish/submit_publish_cache_job.py +++ b/openpype/modules/deadline/plugins/publish/submit_publish_cache_job.py @@ -131,7 +131,6 @@ def _submit_deadline_post_job(self, instance, job): create_metadata_path(instance, anatomy) environment = { - "AVALON_DB": os.environ["AVALON_DB"], "AVALON_PROJECT": instance.context.data["projectName"], "AVALON_ASSET": instance.context.data["asset"], "AVALON_TASK": instance.context.data["task"], @@ -147,6 +146,7 @@ def _submit_deadline_post_job(self, instance, job): environment["AYON_BUNDLE_NAME"] = os.environ["AYON_BUNDLE_NAME"] deadline_plugin = "Ayon" else: + environment["AVALON_DB"] = os.environ["AVALON_DB"] environment["OPENPYPE_PUBLISH_JOB"] = "1" environment["OPENPYPE_RENDER_JOB"] = "0" environment["OPENPYPE_REMOTE_PUBLISH"] = "0"