config: simplify
This commit is contained in:
parent
dac18c823a
commit
bdeb278728
|
@ -68,16 +68,12 @@ func (r *Resource) Id() string {
|
||||||
// ResourceGraph returns a dependency graph of the resources from this
|
// ResourceGraph returns a dependency graph of the resources from this
|
||||||
// Terraform configuration.
|
// Terraform configuration.
|
||||||
func (c *Config) ResourceGraph() *depgraph.Graph {
|
func (c *Config) ResourceGraph() *depgraph.Graph {
|
||||||
resource2Noun := func(r *Resource) *depgraph.Noun {
|
nouns := make(map[string]*depgraph.Noun)
|
||||||
return &depgraph.Noun{
|
for _, r := range c.Resources {
|
||||||
|
noun := &depgraph.Noun{
|
||||||
Name: r.Id(),
|
Name: r.Id(),
|
||||||
Meta: r,
|
Meta: r,
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
nouns := make(map[string]*depgraph.Noun)
|
|
||||||
for _, r := range c.Resources {
|
|
||||||
noun := resource2Noun(r)
|
|
||||||
nouns[noun.Name] = noun
|
nouns[noun.Name] = noun
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue