Fix to not put fixed_ip in request if not defined
This commit is contained in:
parent
88c3933356
commit
1de2fde147
|
@ -245,8 +245,13 @@ func resourcePortSecurityGroupsV2(d *schema.ResourceData) []string {
|
||||||
return groups
|
return groups
|
||||||
}
|
}
|
||||||
|
|
||||||
func resourcePortFixedIpsV2(d *schema.ResourceData) []ports.IP {
|
func resourcePortFixedIpsV2(d *schema.ResourceData) interface{} {
|
||||||
rawIP := d.Get("fixed_ip").([]interface{})
|
rawIP := d.Get("fixed_ip").([]interface{})
|
||||||
|
|
||||||
|
if len(rawIP) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
ip := make([]ports.IP, len(rawIP))
|
ip := make([]ports.IP, len(rawIP))
|
||||||
for i, raw := range rawIP {
|
for i, raw := range rawIP {
|
||||||
rawMap := raw.(map[string]interface{})
|
rawMap := raw.(map[string]interface{})
|
||||||
|
@ -255,8 +260,8 @@ func resourcePortFixedIpsV2(d *schema.ResourceData) []ports.IP {
|
||||||
IPAddress: rawMap["ip_address"].(string),
|
IPAddress: rawMap["ip_address"].(string),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ip
|
return ip
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func resourcePortAdminStateUpV2(d *schema.ResourceData) *bool {
|
func resourcePortAdminStateUpV2(d *schema.ResourceData) *bool {
|
||||||
|
|
Loading…
Reference in New Issue