helper/resource: improve logging and output for tests

This commit is contained in:
Mitchell Hashimoto 2014-07-11 11:20:18 -07:00
parent 8d065ce5c4
commit 91ad873113
2 changed files with 9 additions and 1 deletions

View File

@ -62,6 +62,12 @@ func (m *Map) Apply(
if s.ID == "" {
result, err = r.Create(s, d, meta)
} else {
if r.Update == nil {
return s, fmt.Errorf(
"Resource type '%s' doesn't support update",
s.Type)
}
result, err = r.Update(s, d, meta)
}
if result != nil {

View File

@ -202,9 +202,11 @@ func testStep(
}
// Plan!
if _, err := ctx.Plan(&terraform.PlanOpts{Destroy: step.Destroy}); err != nil {
if p, err := ctx.Plan(&terraform.PlanOpts{Destroy: step.Destroy}); err != nil {
return state, fmt.Errorf(
"Error planning: %s", err)
} else {
log.Printf("[WARN] Test: Step plan: %s", p)
}
// Apply!