feat(config): Add check if setting is incorrectly empty
This commit is contained in:
parent
b64dc5f595
commit
b830f84ebe
@ -171,6 +171,21 @@ def is_same_as_default(
|
|||||||
return config_kv_pair in ini_defaults
|
return config_kv_pair in ini_defaults
|
||||||
|
|
||||||
|
|
||||||
|
def we_have_unset_options(
|
||||||
|
config_obj: configparser.ConfigParser(),
|
||||||
|
section_name: str) -> list:
|
||||||
|
|
||||||
|
options_must_be_non_empty = []
|
||||||
|
|
||||||
|
for option in config_obj.options(section_name):
|
||||||
|
if not config_obj.get(section_name, option):
|
||||||
|
if option not in internal_empty_ok:
|
||||||
|
log.warning(f"In section '[{section_name}]' option '{option}' is empty, it mustn't be.")
|
||||||
|
options_must_be_non_empty.append(option)
|
||||||
|
|
||||||
|
return options_must_be_non_empty
|
||||||
|
|
||||||
|
|
||||||
def validate_config_sections(
|
def validate_config_sections(
|
||||||
config_obj: configparser.ConfigParser()) -> None:
|
config_obj: configparser.ConfigParser()) -> None:
|
||||||
for this_section in config_obj.sections():
|
for this_section in config_obj.sections():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user