From 0a7e963afd224897461ffcc1fe089c48cb97aa3f Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Thu, 26 Oct 2017 11:09:53 -0400 Subject: [PATCH] Output env cmd file as a possible bash like format for easier debugging Signed-off-by: Jonathan Rajotte --- lttng_ivc/utils/runtime.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lttng_ivc/utils/runtime.py b/lttng_ivc/utils/runtime.py index a89c23b..0103dbf 100644 --- a/lttng_ivc/utils/runtime.py +++ b/lttng_ivc/utils/runtime.py @@ -147,7 +147,8 @@ class Runtime(object): env_path = os.path.join(self.__runtime_log, str(tmp_id) + ".env") with open(env_path, 'w') as env_out: - pprint.pprint(env, stream=env_out) + for key, value in env.items(): + env_out.write('{}={}\n'.format(key, value)) cp = subprocess.run(args, stdout=stdout, stderr=stderr, env=env, cwd=cwd) _logger.debug("Command #{} args: {} stdout: {} stderr{}".format(tmp_id, cp.args, out_path, err_path)) -- 2.34.1