terraform: fail early if module validation fails

This commit is contained in:
Mitchell Hashimoto 2015-06-24 22:43:55 -07:00
parent 38efe4cb80
commit 785defc870
1 changed files with 6 additions and 0 deletions

View File

@ -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