Skip to content

Commit

Permalink
Merge pull request #16893 from os-autoinst/revert-16730-terraformdebug
Browse files Browse the repository at this point in the history
Revert "Get rid of unused TERRAFORM_LOG variable"
  • Loading branch information
asmorodskyi committed Apr 19, 2023
2 parents d070894 + 03d3ccb commit e392dbc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/publiccloud/provider.pm
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,12 @@ sub terraform_apply {

script_retry($cmd, timeout => $terraform_timeout, delay => 3, retry => 6);

# Valid values according to documentation: TRACE, DEBUG, INFO, WARN, ERROR & OFF
# https://developer.hashicorp.com/terraform/internals/debugging
my $tf_log = get_var("TERRAFORM_LOG", "");

# The $terraform_timeout must higher than $terraform_vm_create_timeout (See also var.vm_create_timeout in *.tf file)
my $ret = script_run("terraform apply -no-color -input=false myplan", $terraform_timeout);
my $ret = script_run("TF_LOG=$tf_log terraform apply -no-color -input=false myplan", $terraform_timeout);
$self->terraform_applied(1); # Must happen here to prevent resource leakage
unless (defined $ret) {
if (is_serial_terminal()) {
Expand Down

0 comments on commit e392dbc

Please sign in to comment.