summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2015-05-03 15:26:21 +0200
committerGuido Günther <agx@sigxcpu.org>2015-05-03 15:26:21 +0200
commite0d527b047f4671eafd5aa8b1fb9b75728152b1e (patch)
tree769158f8ae92cff87251dbdc23767d53843ec03e
parent21c3c90a1be45b6a10b7d14efc4b40426340442a (diff)
config: move warning to separate method
-rw-r--r--gbp/config.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/gbp/config.py b/gbp/config.py
index 9f8e7fc7..8cfac0d0 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -364,6 +364,10 @@ class GbpOptionParser(OptionParser):
return
parser.read(filename)
+ def _warn_old_config(self, oldcmd, cmd):
+ gbp.log.warn("Old style config section [%s] found "
+ "please rename to [%s]" % (oldcmd, cmd))
+
def parse_config_files(self):
"""
Parse the possible config files and set appropriate values
@@ -392,16 +396,14 @@ class GbpOptionParser(OptionParser):
oldcmd = self.command
if parser.has_section(oldcmd):
self.config.update(dict(parser.items(oldcmd, raw=True)))
- gbp.log.warn("Old style config section [%s] found "
- "please rename to [%s]" % (oldcmd, cmd))
+ self._warn_old_config_section(oldcmd, cmd)
else:
cmd = self.command
for prefix in ['gbp', 'git']:
oldcmd = '%s-%s' % (prefix, self.command)
if parser.has_section(oldcmd):
self.config.update(dict(parser.items(oldcmd, raw=True)))
- gbp.log.warn("Old style config section [%s] found "
- "please rename to [%s]" % (oldcmd, cmd))
+ self._warn_old_config_section(oldcmd, cmd)
# Update with command specific settings
if parser.has_section(cmd):