provider/openstack: gophercloud migration: Update openstack_networking_subnet_v2 to correctly handle Gateway IP
This commit is contained in:
parent
9c856a8f6f
commit
8405a9f118
|
@ -39,5 +39,14 @@ type SubnetCreateOpts struct {
|
|||
// ToSubnetCreateMap casts a CreateOpts struct to a map.
|
||||
// It overrides subnets.ToSubnetCreateMap to add the ValueSpecs field.
|
||||
func (opts SubnetCreateOpts) ToSubnetCreateMap() (map[string]interface{}, error) {
|
||||
return BuildRequest(opts, "subnet")
|
||||
b, err := BuildRequest(opts, "subnet")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if m := b["subnet"].(map[string]interface{}); m["gateway_ip"] == "" {
|
||||
m["gateway_ip"] = nil
|
||||
}
|
||||
|
||||
return b, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue