Skip to content

Commit

Permalink
remove envvar from conf that are in os.environ
Browse files Browse the repository at this point in the history
  • Loading branch information
thesujai committed Jan 18, 2024
1 parent 1e6a08b commit 505cacb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kolibri/utils/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ def _set_from_envvars(conf):
optname=optname, section=section
)
)
conf[section][optname] = os.environ[envvar]
using_env_vars[optname] = envvar
break
return using_env_vars
Expand Down Expand Up @@ -991,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 505cacb

Please sign in to comment.