delete unused code

this search for orphans was never used
This commit is contained in:
James Bardin 2020-05-12 18:28:01 -04:00
parent 8ba63110ec
commit 741aab31d1
1 changed files with 0 additions and 21 deletions

View File

@ -6,7 +6,6 @@ import (
"github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/dag"
"github.com/hashicorp/terraform/lang"
"github.com/hashicorp/terraform/states"
)
// nodeExpandApplyableResource handles the first layer of resource
@ -48,26 +47,6 @@ func (n *nodeExpandApplyableResource) DynamicExpand(ctx EvalContext) (*Graph, er
})
}
// Lock the state while we inspect it to find any resources orphaned by
// changes in module expansion.
state := ctx.State().Lock()
defer ctx.State().Unlock()
var orphans []*states.Resource
for _, res := range state.Resources(n.Addr) {
found := false
for _, m := range moduleInstances {
if m.Equal(res.Addr.Module) {
found = true
break
}
}
// Address form state was not found in the current config
if !found {
orphans = append(orphans, res)
}
}
return &g, nil
}