mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-10-10 16:36:36 +00:00
fix: env vars ignored on first config build
ConfigEOS.__init__ passed self as first positional argument to _setup, which forwards it to pydantic_settings.BaseSettings.__init__. Its first positional parameter is _case_sensitive, so the environment source matched the upper case variable names against the lower case field names and returned nothing. Environment settings only took effect after the next configuration setup.
This commit is contained in:
@@ -717,7 +717,9 @@ class ConfigEOS(SingletonMixin, SettingsEOSDefaults):
|
||||
logger.debug("Config init called again with parameters {} {}", args, kwargs)
|
||||
return
|
||||
logger.debug("Config init with parameters {} {}", args, kwargs)
|
||||
self._setup(self, *args, **kwargs)
|
||||
# Do not pass self - the first positional argument of pydantic_settings.BaseSettings
|
||||
# is _case_sensitive, which would make environment variable lookup case sensitive.
|
||||
self._setup(*args, **kwargs)
|
||||
|
||||
def _setup(self, *args: Any, **kwargs: Any) -> None:
|
||||
"""Re-initialize global settings."""
|
||||
|
||||
Reference in New Issue
Block a user