helper/schema: can set Partial(true) multiple times

This commit is contained in:
Mitchell Hashimoto 2014-10-08 16:35:14 -07:00
parent dd036b0399
commit 0db9d98fff
1 changed files with 3 additions and 4 deletions

View File

@ -114,13 +114,12 @@ func (d *ResourceData) HasChange(key string) bool {
// When partial state mode is enabled, then only key prefixes specified
// by SetPartial will be in the final state. This allows providers to return
// partial states for partially applied resources (when errors occur).
//
// When partial state mode is toggled, the map of enabled partial states
// (by SetPartial) is reset.
func (d *ResourceData) Partial(on bool) {
d.partial = on
if on {
d.partialMap = make(map[string]struct{})
if d.partialMap == nil {
d.partialMap = make(map[string]struct{})
}
} else {
d.partialMap = nil
}