From 785defc8703e69da15daa69b5ea470cd95b02a0d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 24 Jun 2015 22:43:55 -0700 Subject: [PATCH] terraform: fail early if module validation fails --- terraform/context.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/terraform/context.go b/terraform/context.go index 60e5dbea03..531d49310a 100644 --- a/terraform/context.go +++ b/terraform/context.go @@ -434,6 +434,12 @@ func (c *Context) Validate() ([]string, []error) { } } + // If we have errors at this point, the graphing has no chance, + // so just bail early. + if errs != nil { + return nil, []error{errs} + } + // Build the graph so we can walk it and run Validate on nodes. // We also validate the graph generated here, but this graph doesn't // necessarily match the graph that Plan will generate, so we'll validate the