]> git.ipfire.org Git - ddns.git/blobdiff - src/ddns/__init__.py
Allow a missing [config] section.
[ddns.git] / 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.