ynput / ayon-launcher

AYON desktop application launcher
Apache License 2.0
31 stars 13 forks source link

Chore: Ignore empty value of 'AYON_BUNDLE_NAME' env variable #131

Closed iLLiCiTiT closed 1 month ago

iLLiCiTiT commented 1 month ago

Changelog Description

Don't consider empty AYON_BUNDLE_NAME environment variable as defined bundle name.

Additional info

This issue was discovered during testing of deadline jobs. GlobalPreLoadJob.py does set bundle name based on job environment variables, but if that is not filled it does fill empty string "" and because deadline api does not support to "remove env key" (at least I didn't find it) this was the best solution. But at the end, it is not just fixing issue because of deadline, but fixing issue discovered thanks to deadline.

iLLiCiTiT commented 1 month ago

When would you like to remove it from what? The process env vars?

I would have to lookup, but there was a loop over dict[str, str] which always set the value, no matter what. There should be something like:

for key, value in env.items():
    if value:
        someting.setEnvironment(key, value)
    else:
        something.clearEnvironment(key)

But you can't remove single env key.

I also think it does set it on multiple objects? Might not remember correctly.

EDITED: Here https://github.com/ynput/ayon-deadline/blob/develop/client/ayon_deadline/repository/custom/plugins/Ayon/Ayon.py#L90