Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default environment variables #78

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mrpurest
Copy link

Check for DefaultDeadlineEnvVar and add to the environment if it exists.

the idea is that I can add:

import GafferDeadline
GafferDeadline.DefaultDeadlineEnvVar = {"MY_IMPORTANT_ENV": "whatever"}

to a gaffer startup file, and now all my tasks will have the needed environment.

I don't know if this is the best approach but it seems to work.

Check for DefaultDeadlineEnvVar and add to the environment if it exists
@ericmehl
Copy link
Member

This is one approach that can work, though I'd rather add more official API for it such as setDefaultEnvironmentVariables / getDefaultEnvironmentVariables so it's more visible than checking for an attribute the user has inserted.

But I think something equivalent can now be accomplished with the new extraEnvironmentVariables plug (introduced in 0.58.0.0). That is a CompoundObjectPlug you can set by an expression, or you should be able to set it in a startup script by registering a userDefault metadata entry for it. I haven't tried this yet, so if you do and it doesn't work, let me know and we can figure out why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants