Browse files

normalize option names before merging configs to avoid configobj brai…


renaming an option after merging leaves the original option intact.  This
can leave two options of the same name when generating a config file which
renders a config unreadable by ConfigObj in the future due to a
'Duplicate keyword' error.
  • Loading branch information...
1 parent 0b5fef3 commit 024c271cc256ed560615a91dc97b5e8d25017bd6 @abg abg committed Oct 15, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 holland/core/config/
3 holland/core/config/
@@ -106,20 +106,21 @@ class BackupConfig(BaseConfig):
def __init__(self, path):
BaseConfig.__init__(self, None)
basecfg = BaseConfig(path)
+ basecfg.walk(self._canonicalize, call_on_sections=True)
provider = basecfg.lookup('holland:backup.plugin')
if provider:
configbase = os.path.dirname(os.path.dirname(path))
providerpath = os.path.join(configbase, 'providers', provider)
providerpath += CONFIG_SUFFIX
providercfg = BaseConfig(providerpath)
+ providercfg.walk(self._canonicalize, call_on_sections=True)
except IOError, ex:
LOGGER.warning("Failed to load config for provider %r (%s)" %
(provider, ex))
self.filename = basecfg.filename
- self.walk(self._canonicalize, call_on_sections=True)
class GlobalConfig(BaseConfig):

0 comments on commit 024c271

Please sign in to comment.