From: Michael Tremer Date: Sun, 6 Jul 2014 09:23:57 +0000 (+0200) Subject: Allow a missing [config] section. X-Git-Tag: 001~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=573b679e662e5f50dbec94e23083b4541772a5aa;p=ddns.git Allow a missing [config] section. --- 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.