terraform: resource provisioner self references are not put in the graph

This commit is contained in:
Mitchell Hashimoto 2015-02-13 10:04:11 -08:00
parent edfb11ff1d
commit c70cc682ea
3 changed files with 6 additions and 3 deletions

View File

@ -3535,7 +3535,6 @@ func TestContextApply_errorDestroy_createBeforeDestroy(t *testing.T) {
}
*/
/*
func TestContext2Apply_provisionerResourceRef(t *testing.T) {
m := testModule(t, "apply-provisioner-resource-ref")
p := testProvider("aws")

View File

@ -1,6 +1,8 @@
package terraform
import (
"log"
"github.com/hashicorp/terraform/config/module"
)
@ -29,6 +31,7 @@ func (b *BasicGraphBuilder) Build(path []string) (*Graph, error) {
// Validate the graph structure
if err := g.Validate(); err != nil {
log.Printf("[ERROR] Graph validation failed. Graph: %s", g.String())
return nil, err
}

View File

@ -189,6 +189,7 @@ func (n *GraphNodeConfigResource) DependentOn() []string {
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)
@ -201,12 +202,12 @@ func (n *GraphNodeConfigResource) DependentOn() []string {
}
for _, p := range n.Resource.Provisioners {
for _, v := range p.ConnInfo.Variables {
if vn := varNameForVar(v); vn != "" {
if vn := varNameForVar(v); vn != "" && vn != n.Resource.Id() {
result = append(result, vn)
}
}
for _, v := range p.RawConfig.Variables {
if vn := varNameForVar(v); vn != "" {
if vn := varNameForVar(v); vn != "" && vn != n.Resource.Id() {
result = append(result, vn)
}
}