feat(config): Detect unexpected config items from config files.

This commit is contained in:
Terry Geng
2022-01-21 23:58:49 -05:00
parent 9ba27207ea
commit 37666c7daf
6 changed files with 142 additions and 108 deletions

13
util.py
View File

@ -561,3 +561,16 @@ def clear_tmp_folder(path, size):
except (FileNotFoundError, OSError):
continue
return
def check_extra_config(config, template):
extra = []
for key in config.sections():
if key in ['radio']:
continue
for opt in config.options(key):
if not template.has_option(key, opt):
extra.append((key, opt))
return extra