terraform: applyFn

This commit is contained in:
Mitchell Hashimoto 2014-06-18 16:09:48 -07:00
parent b3e20a3e85
commit 9f5b6cc40f
1 changed files with 12 additions and 3 deletions

View File

@ -310,9 +310,18 @@ func testProviderFunc(n string, rs []string) ResourceProviderFactory {
applyFn := func( applyFn := func(
s *ResourceState, s *ResourceState,
d *ResourceDiff) (*ResourceState, error) { d *ResourceDiff) (*ResourceState, error) {
return &ResourceState{ result := &ResourceState{
ID: "foo", ID: "foo",
}, nil Attributes: make(map[string]string),
}
if d != nil {
for ak, ad := range d.Attributes {
result.Attributes[ak] = ad.New
}
}
return result, nil
} }
diffFn := func( diffFn := func(