Revert "[WIP] core: Log diff mismatch using spew instead of %#v"
This commit is contained in:
parent
b20f43834b
commit
b72ef90c2f
|
@ -5,7 +5,6 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
|
||||||
"github.com/hashicorp/terraform/config"
|
"github.com/hashicorp/terraform/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -43,11 +42,10 @@ func (n *EvalCompareDiff) Eval(ctx EvalContext) (interface{}, error) {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if same, reason := one.Same(two); !same {
|
if same, reason := one.Same(two); !same {
|
||||||
spew.Config.SortKeys = true
|
|
||||||
log.Printf("[ERROR] %s: diffs didn't match", n.Info.Id)
|
log.Printf("[ERROR] %s: diffs didn't match", n.Info.Id)
|
||||||
log.Printf("[ERROR] %s: reason: %s", n.Info.Id, reason)
|
log.Printf("[ERROR] %s: reason: %s", n.Info.Id, reason)
|
||||||
log.Printf("[ERROR] %s: diff one: %s", n.Info.Id, spew.Sdump(one))
|
log.Printf("[ERROR] %s: diff one: %#v", n.Info.Id, one)
|
||||||
log.Printf("[ERROR] %s: diff two: %s", n.Info.Id, spew.Sdump(two))
|
log.Printf("[ERROR] %s: diff two: %#v", n.Info.Id, two)
|
||||||
return nil, fmt.Errorf(
|
return nil, fmt.Errorf(
|
||||||
"%s: diffs didn't match during apply. This is a bug with "+
|
"%s: diffs didn't match during apply. This is a bug with "+
|
||||||
"Terraform and should be reported as a GitHub Issue.\n"+
|
"Terraform and should be reported as a GitHub Issue.\n"+
|
||||||
|
@ -57,12 +55,12 @@ func (n *EvalCompareDiff) Eval(ctx EvalContext) (interface{}, error) {
|
||||||
" Terraform Version: %s\n"+
|
" Terraform Version: %s\n"+
|
||||||
" Resource ID: %s\n"+
|
" Resource ID: %s\n"+
|
||||||
" Mismatch reason: %s\n"+
|
" Mismatch reason: %s\n"+
|
||||||
" Diff One (usually from plan): %s\n"+
|
" Diff One (usually from plan): %#v\n"+
|
||||||
" Diff Two (usually from apply): %s\n"+
|
" Diff Two (usually from apply): %#v\n"+
|
||||||
"\n"+
|
"\n"+
|
||||||
"Also include as much context as you can about your config, state, "+
|
"Also include as much context as you can about your config, state, "+
|
||||||
"and the steps you performed to trigger this error.\n",
|
"and the steps you performed to trigger this error.\n",
|
||||||
n.Info.Id, Version, n.Info.Id, reason, spew.Sdump(one), spew.Sdump(two))
|
n.Info.Id, Version, n.Info.Id, reason, one, two)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
|
Loading…
Reference in New Issue