Commit 78c82e25 authored by Pierre Paleo's avatar Pierre Paleo
Browse files

Remove unsupported params from nabu config

parent 6880ebdd
......@@ -153,6 +153,7 @@ def validate_nabu_config(config):
if isinstance(config, str):
config = NabuConfigParser(config).conf_dict
res_config = {}
to_remove = []
for section, section_content in config.items():
# Ignore the "other" section
if section.lower() == "other":
......@@ -168,20 +169,27 @@ def validate_nabu_config(config):
continue # deleted key
if opt is None:
raise ValueError("Unknown option '%s' in section [%s]" % (key, section_updated))
if nabu_config[section_updated][key]["type"] == "unsupported":
to_remove.append((section_updated, key))
validator = nabu_config[section_updated][key]["validator"]
if section_updated not in res_config: # missing section - handled later
res_config[section_updated][key] = validator(section_updated, key, value)
# Remove 'unsupported' params
for param in to_remove:
# Handle sections missing in config
for section in (set(nabu_config.keys()) - set(res_config.keys())):
res_config[section] = _extract_nabuconfig_section(section)
for key, value in res_config[section].items():
if nabu_config[section][key]["type"] == "unsupported":
validator = nabu_config[section][key]["validator"]
res_config[section][key] = validator(section, key, value)
return res_config
def convert_dict_values(dic, val_replacements, bytes_tostring=False):
Modify a dictionary to be able to export it with
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment