From 573b679e662e5f50dbec94e23083b4541772a5aa Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 6 Jul 2014 11:23:57 +0200 Subject: [PATCH] Allow a missing [config] section. --- src/ddns/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ddns/__init__.py b/src/ddns/__init__.py index 78009e3..36a552b 100644 --- a/src/ddns/__init__.py +++ b/src/ddns/__init__.py @@ -86,8 +86,13 @@ class DDNSCore(object): configs.read([filename,]) # First apply all global configuration settings. - for k, v in configs.items("config"): - self.settings[k] = v + try: + for k, v in configs.items("config"): + self.settings[k] = v + + # Allow missing config section + except ConfigParser.NoSectionError: + pass for entry in configs.sections(): # Skip the special config section. -- 2.39.2