Skip to content

Commit

Permalink
don't override already set env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Nov 25, 2024
1 parent be04818 commit 20183ed
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 20183ed

Please sign in to comment.