Skip to content

Commit

Permalink
Merge pull request nutanix#203 from yannickstruyf3/bugfix/issue-201-r…
Browse files Browse the repository at this point in the history
…ead-error-categories

added return nil in read function
  • Loading branch information
marinsalinas authored Nov 30, 2020
2 parents 897edf3 + 0b4228d commit 6ce4136
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions nutanix/resource_nutanix_category_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func resourceNutanixCategoryKeyRead(d *schema.ResourceData, meta interface{}) er
if err != nil {
if strings.Contains(fmt.Sprint(err), "ENTITY_NOT_FOUND") {
d.SetId("")
return nil
}
return err
}
Expand Down
3 changes: 2 additions & 1 deletion nutanix/resource_nutanix_category_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ func resourceNutanixCategoryValueRead(d *schema.ResourceData, meta interface{})
resp, err := conn.V3.GetCategoryValue(name.(string), d.Id())

if err != nil {
if strings.Contains(fmt.Sprint(err), "ENTITY_NOT_FOUND") {
if strings.Contains(fmt.Sprint(err), "ENTITY_NOT_FOUND") || strings.Contains(fmt.Sprint(err), "CATEGORY_NAME_VALUE_MISMATCH") {
d.SetId("")
return nil
}
return err
}
Expand Down

0 comments on commit 6ce4136

Please sign in to comment.