backend/local: Bail immediately if terraform.Context can't be created

This commit is contained in:
Martin Atkins 2018-08-24 16:51:57 -07:00
parent 7139887565
commit a6b5980a4f
1 changed files with 3 additions and 0 deletions

View File

@ -77,6 +77,9 @@ func (b *Local) context(op *backend.Operation) (*terraform.Context, *configload.
tfCtx, configSnap, ctxDiags = b.contextDirect(op, opts)
}
diags = diags.Append(ctxDiags)
if diags.HasErrors() {
return nil, nil, nil, diags
}
// If we have an operation, then we automatically do the input/validate
// here since every option requires this.