From 206cc984e909b70a6a0323545a2363c1d4d86d8f Mon Sep 17 00:00:00 2001 From: Aaron Lane Date: Tue, 12 Jun 2018 10:56:33 -0400 Subject: [PATCH] Add TF_WARN_OUTPUT_ERRORS to shell out environment This variable is a workaround for https://github.com/hashicorp/terraform/issues/17655. --- lib/kitchen/terraform/shell_out.rb | 2 +- spec/lib/kitchen/terraform/shell_out_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kitchen/terraform/shell_out.rb b/lib/kitchen/terraform/shell_out.rb index c78e5f739..e24b7b311 100644 --- a/lib/kitchen/terraform/shell_out.rb +++ b/lib/kitchen/terraform/shell_out.rb @@ -72,7 +72,7 @@ def self.run_shell_out(command:, options:) ::Mixlib::ShellOut .new( "terraform #{command}", - options.merge(environment: {"TF_IN_AUTOMATION" => "true"}) + options.merge(environment: {"TF_IN_AUTOMATION" => "true", "TF_WARN_OUTPUT_ERRORS" => "1"}) ) .tap do |shell_out| shell_out diff --git a/spec/lib/kitchen/terraform/shell_out_spec.rb b/spec/lib/kitchen/terraform/shell_out_spec.rb index c45e39cea..eaebfead5 100644 --- a/spec/lib/kitchen/terraform/shell_out_spec.rb +++ b/spec/lib/kitchen/terraform/shell_out_spec.rb @@ -41,7 +41,7 @@ end let :environment do - {"TF_IN_AUTOMATION" => "true"} + {"TF_IN_AUTOMATION" => "true", "TF_WARN_OUTPUT_ERRORS" => "1"} end let :logger do