docs(debug): Warn user when a section doesn't have all mandatory options set

This commit is contained in:
hygienic-books 2022-07-05 04:46:01 +02:00
parent 40290fdc59
commit 1e53adb529

View File

@ -163,8 +163,8 @@ def validate_config_sections(
for this_section in config_obj.sections():
log.debug(print_section_header(this_section))
if not set(CONST.CFG_MANDATORY).issubset(config_obj.options(this_section, no_defaults=True)):
log.debug(f"Config section '[{this_section}]' does not have all mandatory options "
f"{CONST.CFG_MANDATORY} set, skipping section ...")
log.warning(f"Config section '[{this_section}]' does not have all mandatory options "
f"{CONST.CFG_MANDATORY} set, skipping section ...")
config_obj.remove_section(this_section)
else:
for key in config_obj.options(this_section, no_defaults=True):