provider/openstack: gophercloud migration: Add a 'MapValueSpecs' function which can be used to convert
'value_specs' resource data to a map.
This commit is contained in:
parent
796e076313
commit
ffd5370213
|
@ -18,6 +18,15 @@ func CheckDeleted(d *schema.ResourceData, err error, msg string) error {
|
|||
return fmt.Errorf("%s: %s", msg, err)
|
||||
}
|
||||
|
||||
// MapValueSpecs converts ResourceData into a map
|
||||
func MapValueSpecs(d *schema.ResourceData) map[string]string {
|
||||
m := make(map[string]string)
|
||||
for key, val := range d.Get("value_specs").(map[string]interface{}) {
|
||||
m[key] = val.(string)
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
// BuildRequest takes an opts struct and builds a request body for
|
||||
// Gophercloud to execute
|
||||
func BuildRequest(opts interface{}, parent string) (map[string]interface{}, error) {
|
||||
|
|
Loading…
Reference in New Issue