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(
s *ResourceState,
d *ResourceDiff) (*ResourceState, error) {
return &ResourceState{
ID: "foo",
}, nil
result := &ResourceState{
ID: "foo",
Attributes: make(map[string]string),
}
if d != nil {
for ak, ad := range d.Attributes {
result.Attributes[ak] = ad.New
}
}
return result, nil
}
diffFn := func(