1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-12 05:39:23 +01:00

Fix conf.get_config() to correctly handle overrides when env variables are set

This commit is contained in:
Daniel Mach 2024-04-26 10:18:39 +02:00
parent 8b6908103a
commit 253f6f6ca5

View File

@ -1974,6 +1974,9 @@ def get_config(override_conffile=None,
# priority: env, overrides, config
if env_key in os.environ:
value = os.environ[env_key]
# remove any matching records from overrides because they are checked for emptiness later
overrides.pop(name, None)
overrides.pop(ini_key, None)
elif name in overrides:
value = overrides.pop(name)
elif ini_key in overrides: