Skip to content

Commit

Permalink
Do not anonymize the error for obj.read_object. This prevents the err…
Browse files Browse the repository at this point in the history
…or from bubbling up to Terraform!
  • Loading branch information
DRuggeri committed Jul 5, 2019
1 parent 6e5a602 commit f63b36f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions restapi/resource_api_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ func resourceRestApiImport(d *schema.ResourceData, meta interface{}) (imported [
}
log.Printf("resource_api_object.go: Import routine called. Object built:\n%s\n", obj.toString())

if err := obj.read_object(); err == nil {
err = obj.read_object()
if err == nil {
set_resource_state(obj, d)
/* Data that we set in the state above must be passed along
as an item in the stack of imported data */
Expand Down Expand Up @@ -210,7 +211,8 @@ func resourceRestApiExists(d *schema.ResourceData, meta interface{}) (exists boo

/* Assume all errors indicate the object just doesn't exist.
This may not be a good assumption... */
if err := obj.read_object(); err == nil {
err = obj.read_object()
if err == nil {
exists = true
}
return exists, err
Expand Down

0 comments on commit f63b36f

Please sign in to comment.