Skip to content

Commit

Permalink
DRAFT: Terraform output shown in logs as a single string without new …
Browse files Browse the repository at this point in the history
…lines.

Print the terraform output to log.info which print new lines and its clear to read
  • Loading branch information
bkopilov committed Jan 30, 2025
1 parent e0c0834 commit d6dfc9a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/assisted_test_infra/test_infra/tools/terraform_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit d6dfc9a

Please sign in to comment.