From d6dfc9a902697b0e4d063914ad15acaeeb266f0f Mon Sep 17 00:00:00 2001 From: Benny Kopilov Date: Thu, 30 Jan 2025 13:24:29 +0200 Subject: [PATCH] DRAFT: Terraform output shown in logs as a single string without new lines. Print the terraform output to log.info which print new lines and its clear to read --- src/assisted_test_infra/test_infra/tools/terraform_utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/assisted_test_infra/test_infra/tools/terraform_utils.py b/src/assisted_test_infra/test_infra/tools/terraform_utils.py index 839ed51b1e6..0b029b6b06c 100644 --- a/src/assisted_test_infra/test_infra/tools/terraform_utils.py +++ b/src/assisted_test_infra/test_infra/tools/terraform_utils.py @@ -36,6 +36,7 @@ def __init__(self, working_dir: str, terraform_init: bool = True): self.tf = _Terraform( working_dir=working_dir, state=consts.TFSTATE_FILE, + parallelism=6, var_file=consts.TFVARS_JSON_NAME, is_env_vars_included=True, ) @@ -74,6 +75,10 @@ def apply( return_value, output, err = self.tf.apply( no_color=IsFlagged, refresh=refresh, input=False, skip_plan=True, capture_output=capture_output ) + # print terraform output line by line without \n + if output and type(output) is str: + log.info(output) + if return_value == 0: return