mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
fix stacktrace crash when env vars are badly set in config.yml
This was trying to delete from a dict that was being iterated through. Python doesn't like that!
This commit is contained in:
parent
80891be139
commit
d530733290
1 changed files with 6 additions and 2 deletions
|
|
@ -388,6 +388,7 @@ def read_config(opts):
|
||||||
limit = config['git_mirror_size_limit']
|
limit = config['git_mirror_size_limit']
|
||||||
config['git_mirror_size_limit'] = parse_human_readable_size(limit)
|
config['git_mirror_size_limit'] = parse_human_readable_size(limit)
|
||||||
|
|
||||||
|
confignames_to_delete = set()
|
||||||
for configname, dictvalue in config.items():
|
for configname, dictvalue in config.items():
|
||||||
if configname == 'java_paths':
|
if configname == 'java_paths':
|
||||||
new = dict()
|
new = dict()
|
||||||
|
|
@ -403,14 +404,17 @@ def read_config(opts):
|
||||||
if env:
|
if env:
|
||||||
config[configname] = env
|
config[configname] = env
|
||||||
else:
|
else:
|
||||||
del(config[configname])
|
confignames_to_delete.add(configname)
|
||||||
logging.error(_('Environment variable {var} from {configname} is not set!')
|
logging.error(_('Environment variable {var} from {configname} is not set!')
|
||||||
.format(var=k, configname=configname))
|
.format(var=k, configname=configname))
|
||||||
else:
|
else:
|
||||||
del(config[configname])
|
confignames_to_delete.add(configname)
|
||||||
logging.error(_('Unknown entry {key} in {configname}')
|
logging.error(_('Unknown entry {key} in {configname}')
|
||||||
.format(key=k, configname=configname))
|
.format(key=k, configname=configname))
|
||||||
|
|
||||||
|
for configname in confignames_to_delete:
|
||||||
|
del(config[configname])
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue