Skip to content

Commit

Permalink
Fix to Env Var and Config persisting in options.ini in KOLIBRI_HOME (#…
Browse files Browse the repository at this point in the history
…11737)

* override the configuration to default false

* remove conf overriding in _set_from_envvars

* remove envvar from conf that are in os.environ
  • Loading branch information
thesujai authored Jan 19, 2024
1 parent cde93f0 commit 1f3a554
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kolibri/utils/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,12 @@ def generate_empty_options_file(ini_filename="options.ini"):

conf = read_options_file(ini_filename=ini_filename)

for section, opts in option_spec.items():
for optname, attrs in opts.items():
for envvar in attrs.get("envvars", []):
if envvar in os.environ:
conf[section].pop(optname, None)

comments = None

for section, opts in option_spec.items():
Expand Down

0 comments on commit 1f3a554

Please sign in to comment.