terraform: fixing Refresh tests
This commit is contained in:
parent
9b2b3a963f
commit
e2aa067996
|
@ -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
|
||||
|
|
|
@ -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"])
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue