From 20183ed773eaeb61d3db5a3c9a6b250acabd12c6 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Mon, 25 Nov 2024 11:59:50 +0100 Subject: [PATCH] don't override already set env variables --- .../publish/global/collect_deadline_job_env_vars.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/ayon_deadline/plugins/publish/global/collect_deadline_job_env_vars.py b/client/ayon_deadline/plugins/publish/global/collect_deadline_job_env_vars.py index 35e8d7bee1..6eed713cf1 100644 --- a/client/ayon_deadline/plugins/publish/global/collect_deadline_job_env_vars.py +++ b/client/ayon_deadline/plugins/publish/global/collect_deadline_job_env_vars.py @@ -36,16 +36,16 @@ class CollectDeadlineJobEnvVars(pyblish.api.ContextPlugin): ] def process(self, context): - env = {} + env = context.data.setdefault(JOB_ENV_DATA_KEY, {}) for key in self.ENV_KEYS: + # Skip already set keys + if key in env: + continue value = os.getenv(key) if value: self.log.debug(f"Setting job env: {key}: {value}") env[key] = value - # Transfer some environment variables from current context - context.data.setdefault(JOB_ENV_DATA_KEY, {}).update(env) - class CollectAYONServerToFarmJob(CollectDeadlineJobEnvVars): label = "Add AYON Server URL to farm job"