terraform: remove unused function

This commit is contained in:
Mitchell Hashimoto 2014-09-21 22:35:11 -07:00
parent 73e2a43427
commit 7a97396583
2 changed files with 0 additions and 40 deletions

View File

@ -48,21 +48,6 @@ const (
FlagHasTainted
)
// Vars returns the mapping of variables that should be replaced in
// configuration based on the attributes of this resource.
func (r *Resource) Vars() map[string]string {
if r.State == nil {
return nil
}
vars := make(map[string]string)
for ak, av := range r.State.Attributes {
vars[fmt.Sprintf("%s.%s", r.Id, ak)] = av
}
return vars
}
// ResourceConfig holds the configuration given for a resource. This is
// done instead of a raw `map[string]interface{}` type so that rich
// methods can be added to it to make dealing with it easier.

View File

@ -7,31 +7,6 @@ import (
"github.com/hashicorp/terraform/config"
)
func TestResource_Vars(t *testing.T) {
r := new(Resource)
if len(r.Vars()) > 0 {
t.Fatalf("bad: %#v", r.Vars())
}
r = &Resource{
Id: "key",
State: &InstanceState{
Attributes: map[string]string{
"foo": "bar",
},
},
}
expected := map[string]string{
"key.foo": "bar",
}
actual := r.Vars()
if !reflect.DeepEqual(actual, expected) {
t.Fatalf("bad: %#v", actual)
}
}
func TestResourceConfigGet(t *testing.T) {
cases := []struct {
Config map[string]interface{}