ci: Use os.environ[key] access when value must be set

The other code in this file is using this pattern to throw when a key is
unset, instead of silently returning a None when using os.getenv(key)
with no default value specified.

So use the pattern here as well. As the env vars are always set, this
should be a refactor that does not change the behavior.
This commit is contained in:
MarcoFalke
2025-10-22 11:52:40 +02:00
parent 7d27af98c7
commit fa8e4de5c3

View File

@@ -36,8 +36,8 @@ def main():
# Append $USER to /tmp/env to support multi-user systems and $CONTAINER_NAME
# to allow support starting multiple runs simultaneously by the same user.
env_file = "/tmp/env-{u}-{c}".format(
u=os.getenv("USER"),
c=os.getenv("CONTAINER_NAME"),
u=os.environ["USER"],
c=os.environ["CONTAINER_NAME"],
)
with open(env_file, "w", encoding="utf8") as file:
for k, v in os.environ.items():