Skip to content

Commit

Permalink
core: remove now-unused flatten impls of close nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
phinze committed Jun 29, 2015
1 parent 557b299 commit 184edbe
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 83 deletions.
53 changes: 0 additions & 53 deletions terraform/transform_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,59 +394,6 @@ func (n *graphNodeCloseProvider) DotNode(name string, opts *GraphDotOpts) *dot.N
})
}

// GraphNodeFlattenable impl.
func (n *graphNodeCloseProvider) Flatten(p []string) (dag.Vertex, error) {
return &graphNodeCloseProviderFlat{
graphNodeCloseProvider: n,
PathValue: p,
}, nil
}

// Same as graphNodeCloseProvider, but for flattening
type graphNodeCloseProviderFlat struct {
*graphNodeCloseProvider

PathValue []string
}

func (n *graphNodeCloseProviderFlat) Name() string {
return fmt.Sprintf(
"%s.%s", modulePrefixStr(n.PathValue), n.graphNodeCloseProvider.Name())
}

func (n *graphNodeCloseProviderFlat) Path() []string {
return n.PathValue
}

func (n *graphNodeCloseProviderFlat) ProviderName() string {
return fmt.Sprintf(
"%s.%s", modulePrefixStr(n.PathValue),
n.graphNodeCloseProvider.CloseProviderName())
}

// GraphNodeDependable impl.
func (n *graphNodeCloseProviderFlat) DependableName() []string {
return []string{n.Name()}
}

func (n *graphNodeCloseProviderFlat) DependentOn() []string {
var result []string

// If we're in a module, then depend on our parent's provider
if len(n.PathValue) > 1 {
prefix := modulePrefixStr(n.PathValue[:len(n.PathValue)-1])
if prefix != "" {
prefix += "."
}

result = append(result, fmt.Sprintf(
"%s%s",
prefix, n.graphNodeCloseProvider.Name()))
}

return result
}

type graphNodeMissingProvider struct {
ProviderNameValue string
}
Expand Down
30 changes: 0 additions & 30 deletions terraform/transform_provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,36 +171,6 @@ func (n *graphNodeCloseProvisioner) CloseProvisionerName() string {
return n.ProvisionerNameValue
}

// GraphNodeFlattenable impl.
func (n *graphNodeCloseProvisioner) Flatten(p []string) (dag.Vertex, error) {
return &graphNodeCloseProvisionerFlat{
graphNodeCloseProvisioner: n,
PathValue: p,
}, nil
}

// Same as graphNodeCloseProvisioner, but for flattening
type graphNodeCloseProvisionerFlat struct {
*graphNodeCloseProvisioner

PathValue []string
}

func (n *graphNodeCloseProvisionerFlat) Name() string {
return fmt.Sprintf(
"%s.%s", modulePrefixStr(n.PathValue), n.graphNodeCloseProvisioner.Name())
}

func (n *graphNodeCloseProvisionerFlat) Path() []string {
return n.PathValue
}

func (n *graphNodeCloseProvisionerFlat) ProvisionerName() string {
return fmt.Sprintf(
"%s.%s", modulePrefixStr(n.PathValue),
n.graphNodeCloseProvisioner.CloseProvisionerName())
}

type graphNodeMissingProvisioner struct {
ProvisionerNameValue string
}
Expand Down

0 comments on commit 184edbe

Please sign in to comment.