From dbe5a1254ad6f10d9cd452c0c4c621a873228e87 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 10 Jul 2014 17:01:21 -0700 Subject: [PATCH] helper/resource: better error if config doesn't validate --- helper/resource/testing.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helper/resource/testing.go b/helper/resource/testing.go index cccdef20c..fc03d1cfb 100644 --- a/helper/resource/testing.go +++ b/helper/resource/testing.go @@ -185,9 +185,13 @@ func testStep( opts.State = state ctx := terraform.NewContext(&opts) if ws, es := ctx.Validate(); len(ws) > 0 || len(es) > 0 { + estrs := make([]string, len(es)) + for i, e := range es { + estrs[i] = e.Error() + } return state, fmt.Errorf( "Configuration is invalid.\n\nWarnings: %#v\n\nErrors: %#v", - ws, es) + ws, estrs) } // Refresh!