provider/openstack: gophercloud migration: fixing dhcp and gateway configuration

This commit is contained in:
Joe Topjian 2016-10-17 01:20:23 +00:00
parent 1c6b69e342
commit 17b1787ec2
1 changed files with 6 additions and 3 deletions

View File

@ -155,11 +155,14 @@ func resourceNetworkingSubnetV2Create(d *schema.ResourceData, meta interface{})
createOpts.GatewayIP = &gatewayIP
}
if v, ok := d.GetOk("enable_dhcp"); ok {
enableDHCP := v.(bool)
createOpts.EnableDHCP = &enableDHCP
if noGateway {
disableGateway := ""
createOpts.GatewayIP = &disableGateway
}
enableDHCP := d.Get("enable_dhcp").(bool)
createOpts.EnableDHCP = &enableDHCP
if v, ok := d.GetOk("ip_version"); ok {
ipVersion := resourceNetworkingSubnetV2DetermineIPVersion(v.(int))
createOpts.IPVersion = ipVersion