From c8a2aa7a6cab12da95fa6403183036b283939412 Mon Sep 17 00:00:00 2001 From: Arksine Date: Thu, 4 Mar 2021 21:15:30 -0500 Subject: [PATCH] confighelper: don't warn on valid sections without options Signed-off-by: Eric Callahan --- moonraker/confighelper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/moonraker/confighelper.py b/moonraker/confighelper.py index 951a729..7218eb1 100644 --- a/moonraker/confighelper.py +++ b/moonraker/confighelper.py @@ -21,6 +21,8 @@ class ConfigHelper: self.section = section self.orig_sections = orig_sects self.parsed = parsed + if self.section not in self.parsed: + self.parsed[self.section] = {} self.sections = config.sections self.has_section = config.has_section @@ -60,7 +62,7 @@ class ConfigHelper: f"No option found ({option}) in section [{self.section}]") if self.section in self.orig_sections: # Only track sections included in the original config - self.parsed.setdefault(self.section, {})[option] = val + self.parsed[self.section][option] = val return val def get(self, option, default=Sentinel):