db: fix flavor id parsing (#197)
* Flavor IDs returned with instances are always strings
* Flavor IDs returned with flavors are integers or null, there is a
str_id parameter that contains the ID in string format
diff --git a/openstack/db/v1/flavors/results.go b/openstack/db/v1/flavors/results.go
index f74f20c..0ba515c 100644
--- a/openstack/db/v1/flavors/results.go
+++ b/openstack/db/v1/flavors/results.go
@@ -22,6 +22,7 @@
// Flavor records represent (virtual) hardware configurations for server resources in a region.
type Flavor struct {
// The flavor's unique identifier.
+ // Contains 0 if the ID is not an integer.
ID int `json:"id"`
// The RAM capacity for the flavor.
@@ -32,6 +33,9 @@
// Links to access the flavor.
Links []gophercloud.Link
+
+ // The flavor's unique identifier as a string
+ StrID string `json:"str_id"`
}
// FlavorPage contains a single page of the response from a List call.