diff options
-rw-r--r-- | gbp/config.py | 10 |
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): |