From a49e529a345226d5f2890debf6c1cb14d3ff0ca5 Mon Sep 17 00:00:00 2001 From: Fabricio Brunetti Date: Tue, 19 Nov 2019 19:20:59 -0300 Subject: [PATCH] Leverage PathToAtomicsFolder in Python framework (#675) Parsing the command to replace PathToAtomicsFolder variable. Can-t use environment variables as some Powershell based tests use "$PathToAtomicsFolder". I admit that it-s a bit hackish but I think it-s the most straightforward way to handle this without going through a major refactor of this framework --- execution-frameworks/contrib/python/runner.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/execution-frameworks/contrib/python/runner.py b/execution-frameworks/contrib/python/runner.py index 4e84bda6..53b16fed 100644 --- a/execution-frameworks/contrib/python/runner.py +++ b/execution-frameworks/contrib/python/runner.py @@ -394,6 +394,11 @@ def execute_command(launcher, command, cwd): # We skip empty lines. This is due to the split just above. if comm == "": continue + + # Replace instances of PathToAtomicsFolder + atomics = os.path.join(cwd,"..") + comm = comm.replace("$PathToAtomicsFolder", atomics) + comm = comm.replace("PathToAtomicsFolder", atomics) # # We actually run the command itself. p = subprocess.Popen(launcher, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE,