Enforcing lowercase on the DO Size. This is used for the sizeslug property of API calls - according to their [docs](https://developers.digitalocean.com/documentation/v1/sizes/) this always looks to be lowercase on the slug. I cannot find any definite answer to this question though

This commit is contained in:
stack72 2015-09-18 19:42:37 +01:00
parent a7a7f8393e
commit 9ac39a3edf
1 changed files with 4 additions and 0 deletions

View File

@ -39,6 +39,10 @@ func resourceDigitalOceanDroplet() *schema.Resource {
"size": &schema.Schema{ "size": &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,
Required: true, Required: true,
StateFunc: func(val interface{}) string {
// DO API V2 size slug is always lowercase
return strings.ToLower(val.(string))
},
}, },
"status": &schema.Schema{ "status": &schema.Schema{