From 59c9c150efba3b7b282b29981b5274bf9922de5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 21 Feb 2019 09:42:14 +0100 Subject: [PATCH] orchestrator: Use prefix for config substitutions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will avoid possible conflicts. The names for parts are chosen by users, and if we decide to add more options in the future, this can become handy. JIRA: COMPOSE-3285 Signed-off-by: Lubomír Sedlář --- pungi_utils/orchestrator.py | 4 +++- tests/test_orchestrator.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pungi_utils/orchestrator.py b/pungi_utils/orchestrator.py index d18019de..b94ddc46 100644 --- a/pungi_utils/orchestrator.py +++ b/pungi_utils/orchestrator.py @@ -106,7 +106,9 @@ class ComposePart(object): self.status = Status.READY def setup_start(self, global_config, parts): - substitutions = dict((name, p.path) for name, p in parts.items() if p.is_finished()) + substitutions = dict( + ("part-%s" % name, p.path) for name, p in parts.items() if p.is_finished() + ) substitutions["configdir"] = global_config.config_dir config = kobo.conf.PyConfigParser() diff --git a/tests/test_orchestrator.py b/tests/test_orchestrator.py index 35fe1ddc..79d5f293 100644 --- a/tests/test_orchestrator.py +++ b/tests/test_orchestrator.py @@ -184,7 +184,7 @@ class TestComposePart(PungiTestCase): self.assertEqual(part.log_file, pth("tgt", "logs", "test.log")) self.assertEqual( ficf.call_args_list, - [mock.call("foo.conf", {"base": "/base", "configdir": pth("cfg")})], + [mock.call("foo.conf", {"part-base": "/base", "configdir": pth("cfg")})], ) self.assertEqual( gcd.call_args_list,