mirror of https://github.com/Desuuuu/klipper.git
klippy: Fix detection of mixed case section names
If a section name had mixed case it would cause an incorrect error during the section/option config checking. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
c38a63d4db
commit
20ddd842b7
|
@ -212,12 +212,12 @@ class Printer:
|
|||
m.add_printer_objects(self, config)
|
||||
# Validate that there are no undefined parameters in the config file
|
||||
valid_sections = { s: 1 for s, o in self.all_config_options }
|
||||
for section in fileconfig.sections():
|
||||
section = section.lower()
|
||||
for section_name in fileconfig.sections():
|
||||
section = section_name.lower()
|
||||
if section not in valid_sections and section not in self.objects:
|
||||
raise self.config_error(
|
||||
"Section '%s' is not a valid config section" % (section,))
|
||||
for option in fileconfig.options(section):
|
||||
for option in fileconfig.options(section_name):
|
||||
option = option.lower()
|
||||
if (section, option) not in self.all_config_options:
|
||||
raise self.config_error(
|
||||
|
|
Loading…
Reference in New Issue