From fef687c340d77207efdff215a53da44bd1089795 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Fri, 27 Oct 2017 09:13:52 -0400 Subject: [PATCH] enable output errors in dev branch --- terraform/context_plan_test.go | 23 ++++------------------- terraform/eval_output.go | 23 +++++++++-------------- terraform/features.go | 6 ------ 3 files changed, 13 insertions(+), 39 deletions(-) diff --git a/terraform/context_plan_test.go b/terraform/context_plan_test.go index 1894bf0cca..7dc860bb50 100644 --- a/terraform/context_plan_test.go +++ b/terraform/context_plan_test.go @@ -3593,15 +3593,8 @@ output "out" { } _, err = ctx.Plan() - switch { - case featureOutputErrors: - if err == nil { - t.Fatal("expected error") - } - default: - if err != nil { - t.Fatalf("plan err: %s", err) - } + if err == nil { + t.Fatal("expected error") } } @@ -3648,15 +3641,7 @@ resource "aws_instance" "foo" { } _, err = ctx.Plan() - switch { - case featureOutputErrors: - if err == nil { - t.Fatal("expected error") - } - default: - if err != nil { - t.Fatalf("plan err: %s", err) - } + if err == nil { + t.Fatal("expected error") } - } diff --git a/terraform/eval_output.go b/terraform/eval_output.go index 657c70304c..cc83938eb6 100644 --- a/terraform/eval_output.go +++ b/terraform/eval_output.go @@ -68,22 +68,17 @@ func (n *EvalWriteOutput) Eval(ctx EvalContext) (interface{}, error) { // handling the interpolation error if err != nil { - switch { - case featureOutputErrors: - if n.ContinueOnErr { - log.Printf("[ERROR] Output interpolation %q failed: %s", n.Name, err) - // if we're continueing, make sure the output is included, and - // marked as unknown - mod.Outputs[n.Name] = &OutputState{ - Type: "string", - Value: config.UnknownVariableValue, - } - return nil, EvalEarlyExitError{} + if n.ContinueOnErr { + log.Printf("[ERROR] Output interpolation %q failed: %s", n.Name, err) + // if we're continueing, make sure the output is included, and + // marked as unknown + mod.Outputs[n.Name] = &OutputState{ + Type: "string", + Value: config.UnknownVariableValue, } - return nil, err - default: - log.Printf("[WARN] Output interpolation %q failed: %s", n.Name, err) + return nil, EvalEarlyExitError{} } + return nil, err } // Get the value from the config diff --git a/terraform/features.go b/terraform/features.go index 9bcf19d9c5..752076806f 100644 --- a/terraform/features.go +++ b/terraform/features.go @@ -1,9 +1,3 @@ package terraform -import ( - "os" -) - // This file holds feature flags for the next release - -var featureOutputErrors = os.Getenv("TF_OUTPUT_ERRORS") != ""