Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

normalize option names before merging configs to avoid configobj brai…

…ndamage

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...
commit 024c271cc256ed560615a91dc97b5e8d25017bd6 1 parent 0b5fef3
@abg abg authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  holland/core/config/config.py
View
3  holland/core/config/config.py
@@ -106,6 +106,7 @@ 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:
try:
@@ -113,13 +114,13 @@ def __init__(self, path):
providerpath = os.path.join(configbase, 'providers', provider)
providerpath += CONFIG_SUFFIX
providercfg = BaseConfig(providerpath)
+ providercfg.walk(self._canonicalize, call_on_sections=True)
self.merge(providercfg)
except IOError, ex:
LOGGER.warning("Failed to load config for provider %r (%s)" %
(provider, ex))
self.merge(basecfg)
self.filename = basecfg.filename
- self.walk(self._canonicalize, call_on_sections=True)
class GlobalConfig(BaseConfig):
Please sign in to comment.
Something went wrong with that request. Please try again.