Skip to content

Commit

Permalink
ProjectV2: check error on setting non-scalars
Browse files Browse the repository at this point in the history
Check error on setting non-scalar "all_quotas" and "theme" attributes.
  • Loading branch information
ozerovandrei committed Oct 15, 2018
1 parent 744a687 commit 619f778
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions selvpc/resource_selvpc_resell_project_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,16 @@ func resourceResellProjectV2Read(d *schema.ResourceData, meta interface{}) error
d.Set("name", project.Name)
d.Set("url", project.URL)
d.Set("enabled", project.Enabled)
d.Set("theme", project.Theme)
if err := d.Set("theme", project.Theme); err != nil {
log.Printf("[DEBUG] theme: %s", err)
}

// Set all quotas. This can be different from what the user specified since
// the project will have all available resource quotas automatically applied.
allQuotas := resourceResellProjectV2QuotasToSet(project.Quotas)
d.Set("all_quotas", allQuotas)
if err := d.Set("all_quotas", allQuotas); err != nil {
log.Printf("[DEBUG] all_quotas: %s", err)
}

return nil
}
Expand Down

0 comments on commit 619f778

Please sign in to comment.