From d68bc494277dbbca8b47d6ac97e3cc9275942c90 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Tue, 27 Jun 2017 09:55:16 +0100 Subject: [PATCH] AgendaPaser: fix duplicate source error When both global and config sections are present in an agenda, they both will be processed by the ConfigManager. In each case, the path to the agenda file was specified as the source, which resulted ConfigManager complaining that the same source is being added twice. To avoid that, the source is now suffixed with the section name. --- wa/framework/configuration/parsers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wa/framework/configuration/parsers.py b/wa/framework/configuration/parsers.py index 303a6735..b537abc6 100644 --- a/wa/framework/configuration/parsers.py +++ b/wa/framework/configuration/parsers.py @@ -114,7 +114,7 @@ class AgendaParser(object): if 'run_name' in entry: state.run_config.set('run_name', entry.pop('run_name')) - state.load_config(entry, source, wrap_exceptions=False) + state.load_config(entry, '{}/{}'.format(source, name), wrap_exceptions=False) def _pop_sections(self, raw): sections = raw.pop("sections", [])