From dc07649e8bef02929c76ed73f7b8e1317f7bcbb3 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Fri, 19 Mar 2021 06:58:31 -0400 Subject: [PATCH] Absolutize path for CIP output env In the case where a relative path, or just a filename, is passed as --output-env-file to container image prepare, the output file ends up relative to the cli-container-image-prepare.yaml playbook. In almost all cases, this is not what is expected, especially as the output file could end up in the playbook directory. Instead, absolutize the path, so that the output file ends up relative to the working directory from where the command was run. Signed-off-by: James Slagle Change-Id: I9227365ef2900b1f077ac1abdcb4443957b15958 --- tripleoclient/v1/container_image.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tripleoclient/v1/container_image.py b/tripleoclient/v1/container_image.py index f61a2922e..6a19b08ca 100644 --- a/tripleoclient/v1/container_image.py +++ b/tripleoclient/v1/container_image.py @@ -1085,7 +1085,8 @@ class TripleOImagePrepare(command.Command): extra_vars["debug"] = True if parsed_args.output_env_file: - extra_vars["output_env_file"] = parsed_args.output_env_file + extra_vars["output_env_file"] = os.path.abspath( + parsed_args.output_env_file) with oooutils.TempDirs() as tmp: oooutils.run_ansible_playbook(