diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/helper/schema/resource.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/helper/schema/resource.go | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/vendor/github.com/hashicorp/terraform/helper/schema/resource.go b/vendor/github.com/hashicorp/terraform/helper/schema/resource.go index b5e3065..b59e4e8 100644 --- a/vendor/github.com/hashicorp/terraform/helper/schema/resource.go +++ b/vendor/github.com/hashicorp/terraform/helper/schema/resource.go | |||
@@ -95,9 +95,10 @@ type Resource struct { | |||
95 | // | 95 | // |
96 | // Exists is a function that is called to check if a resource still | 96 | // Exists is a function that is called to check if a resource still |
97 | // exists. If this returns false, then this will affect the diff | 97 | // exists. If this returns false, then this will affect the diff |
98 | // accordingly. If this function isn't set, it will not be called. It | 98 | // accordingly. If this function isn't set, it will not be called. You |
99 | // is highly recommended to set it. The *ResourceData passed to Exists | 99 | // can also signal existence in the Read method by calling d.SetId("") |
100 | // should _not_ be modified. | 100 | // if the Resource is no longer present and should be removed from state. |
101 | // The *ResourceData passed to Exists should _not_ be modified. | ||
101 | Create CreateFunc | 102 | Create CreateFunc |
102 | Read ReadFunc | 103 | Read ReadFunc |
103 | Update UpdateFunc | 104 | Update UpdateFunc |
@@ -329,21 +330,13 @@ func (r *Resource) simpleDiff( | |||
329 | c *terraform.ResourceConfig, | 330 | c *terraform.ResourceConfig, |
330 | meta interface{}) (*terraform.InstanceDiff, error) { | 331 | meta interface{}) (*terraform.InstanceDiff, error) { |
331 | 332 | ||
332 | t := &ResourceTimeout{} | ||
333 | err := t.ConfigDecode(r, c) | ||
334 | |||
335 | if err != nil { | ||
336 | return nil, fmt.Errorf("[ERR] Error decoding timeout: %s", err) | ||
337 | } | ||
338 | |||
339 | instanceDiff, err := schemaMap(r.Schema).Diff(s, c, r.CustomizeDiff, meta, false) | 333 | instanceDiff, err := schemaMap(r.Schema).Diff(s, c, r.CustomizeDiff, meta, false) |
340 | if err != nil { | 334 | if err != nil { |
341 | return instanceDiff, err | 335 | return instanceDiff, err |
342 | } | 336 | } |
343 | 337 | ||
344 | if instanceDiff == nil { | 338 | if instanceDiff == nil { |
345 | log.Printf("[DEBUG] Instance Diff is nil in SimpleDiff()") | 339 | instanceDiff = terraform.NewInstanceDiff() |
346 | return nil, err | ||
347 | } | 340 | } |
348 | 341 | ||
349 | // Make sure the old value is set in each of the instance diffs. | 342 | // Make sure the old value is set in each of the instance diffs. |
@@ -357,10 +350,7 @@ func (r *Resource) simpleDiff( | |||
357 | } | 350 | } |
358 | } | 351 | } |
359 | 352 | ||
360 | if err := t.DiffEncode(instanceDiff); err != nil { | 353 | return instanceDiff, nil |
361 | log.Printf("[ERR] Error encoding timeout to instance diff: %s", err) | ||
362 | } | ||
363 | return instanceDiff, err | ||
364 | } | 354 | } |
365 | 355 | ||
366 | // Validate validates the resource configuration against the schema. | 356 | // Validate validates the resource configuration against the schema. |