From 91c9c6032f215632b3d6e666dd1f855252e616ff Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 26 Jan 2017 20:48:05 -0800 Subject: [PATCH] terraform: remove the old resource node --- terraform/graph_config_node_resource.go | 80 ------------------------- 1 file changed, 80 deletions(-) delete mode 100644 terraform/graph_config_node_resource.go diff --git a/terraform/graph_config_node_resource.go b/terraform/graph_config_node_resource.go deleted file mode 100644 index 6bb0410f08..0000000000 --- a/terraform/graph_config_node_resource.go +++ /dev/null @@ -1,80 +0,0 @@ -package terraform - -import ( - "github.com/hashicorp/terraform/config" -) - -// GraphNodeConfigResource represents a resource within the config graph. -type GraphNodeConfigResource struct { - Resource *config.Resource - - // If set to true, this resource represents a resource - // that will be destroyed in some way. - Destroy bool - - // Used during DynamicExpand to target indexes - Targets []ResourceAddress - - Path []string -} - -// GraphNodeDependent impl. -func (n *GraphNodeConfigResource) DependentOn() []string { - result := make([]string, len(n.Resource.DependsOn), - (len(n.Resource.RawCount.Variables)+ - len(n.Resource.RawConfig.Variables)+ - len(n.Resource.DependsOn))*2) - copy(result, n.Resource.DependsOn) - - for _, v := range n.Resource.RawCount.Variables { - if vn := varNameForVar(v); vn != "" { - result = append(result, vn) - } - } - for _, v := range n.Resource.RawConfig.Variables { - if vn := varNameForVar(v); vn != "" { - result = append(result, vn) - } - } - for _, p := range n.Resource.Provisioners { - for _, v := range p.ConnInfo.Variables { - if vn := varNameForVar(v); vn != "" && vn != n.Resource.Id() { - result = append(result, vn) - } - } - for _, v := range p.RawConfig.Variables { - if vn := varNameForVar(v); vn != "" && vn != n.Resource.Id() { - result = append(result, vn) - } - } - } - - return result -} - -// VarWalk calls a callback for all the variables that this resource -// depends on. -func (n *GraphNodeConfigResource) VarWalk(fn func(config.InterpolatedVariable)) { - for _, v := range n.Resource.RawCount.Variables { - fn(v) - } - for _, v := range n.Resource.RawConfig.Variables { - fn(v) - } - for _, p := range n.Resource.Provisioners { - for _, v := range p.ConnInfo.Variables { - fn(v) - } - for _, v := range p.RawConfig.Variables { - fn(v) - } - } -} - -func (n *GraphNodeConfigResource) Name() string { - result := n.Resource.Id() - if n.Destroy { - result += " (destroy)" - } - return result -}