config: Allow specifying configuration values with no default.
[matthijs/projects/backupninja.git] / src / lib / backupninja / config.py
index 0720f0aa05e36f6c38824728de1d86bee957ca41..030fc573121a83474e3486a5c0d5234921555eb4 100644 (file)
@@ -89,4 +89,7 @@ def _set_default_config(parser, values):
         if not parser.has_section(section):
             parser.add_section(section)
         for option, value in options.items():
-            parser.set(section, option, value)
+            # Interpret None as "no default", since ConfigParser doesn't
+            # like non-string values.
+            if not value is None:
+                parser.set(section, option, value)