terraform: fixing Refresh tests

This commit is contained in:
Mitchell Hashimoto 2014-09-17 16:47:26 -07:00
parent 9b2b3a963f
commit e2aa067996
2 changed files with 2 additions and 2 deletions

View File

@ -892,7 +892,7 @@ func (c *Context) refreshWalkFn() depgraph.WalkFunc {
// TODO: Handle other moduels
mod := c.state.RootModule()
if len(r.State.Tainted) == 0 && (r.State.Primary == nil || r.State.Primary.ID == "") {
if len(r.State.Tainted) == 0 && (is == nil || is.ID == "") {
delete(mod.Resources, r.Id)
} else {
mod.Resources[r.Id] = r.State

View File

@ -2003,7 +2003,7 @@ func TestContextRefresh(t *testing.T) {
if p.RefreshState.ID != "foo" {
t.Fatalf("bad: %#v", p.RefreshState)
}
if !reflect.DeepEqual(mod.Resources["aws_instance.web"], p.RefreshReturn) {
if !reflect.DeepEqual(mod.Resources["aws_instance.web"].Primary, p.RefreshReturn) {
t.Fatalf("bad: %#v", mod.Resources["aws_instance.web"])
}