From 23d96248aac240bf8f901636a11a6768f2db20e3 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 5 Jun 2014 12:59:55 -0700 Subject: [PATCH] No need for a root name constant, just check for Meta == nil --- config/config.go | 6 +----- terraform/terraform.go | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/config/config.go b/config/config.go index 87145828a..9cf957f52 100644 --- a/config/config.go +++ b/config/config.go @@ -9,10 +9,6 @@ import ( "github.com/hashicorp/terraform/depgraph" ) -// GraphRoot is the name of the resource graph root that should be -// ignored since it doesn't map to an exact resource. -const GraphRoot = "root" - // Config is the configuration that comes from loading a collection // of Terraform templates. type Config struct { @@ -207,7 +203,7 @@ func (c *Config) Graph() *depgraph.Graph { } // Create a root that just depends on everything else finishing. - root := &depgraph.Noun{Name: GraphRoot} + root := &depgraph.Noun{Name: "root"} for _, n := range nounsList { root.Deps = append(root.Deps, &depgraph.Dependency{ Name: n.Name, diff --git a/terraform/terraform.go b/terraform/terraform.go index 6c1b5b783..1b3f6c214 100644 --- a/terraform/terraform.go +++ b/terraform/terraform.go @@ -107,7 +107,7 @@ func (t *Terraform) diffWalkFn( return func(n *depgraph.Noun) error { // If it is the root node, ignore - if n.Name == config.GraphRoot { + if n.Meta == nil { return nil }