]> git.ipfire.org Git - ddns.git/commitdiff
Allow a missing [config] section.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 6 Jul 2014 09:23:57 +0000 (11:23 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 6 Jul 2014 09:23:57 +0000 (11:23 +0200)
src/ddns/__init__.py

index 78009e33e98cf1a30531e4fc1ff15074007e37ef..36a552bf3dff4b9fa7629b6a1f668cade67378d3 100644 (file)
@@ -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.