orchestrator: Use prefix for config substitutions

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ář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2019-02-21 09:42:14 +01:00
parent 5a251ff24c
commit 59c9c150ef
2 changed files with 4 additions and 2 deletions

View File

@ -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()

View File

@ -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,