Merge pull request #4617 from ebsco/master

Fix to not put fixed_ip in request if not defined
This commit is contained in:
Joe Topjian 2016-01-10 19:39:21 -07:00
commit f1b55de7c8
1 changed files with 7 additions and 2 deletions

View File

@ -245,8 +245,13 @@ func resourcePortSecurityGroupsV2(d *schema.ResourceData) []string {
return groups
}
func resourcePortFixedIpsV2(d *schema.ResourceData) []ports.IP {
func resourcePortFixedIpsV2(d *schema.ResourceData) interface{} {
rawIP := d.Get("fixed_ip").([]interface{})
if len(rawIP) == 0 {
return nil
}
ip := make([]ports.IP, len(rawIP))
for i, raw := range rawIP {
rawMap := raw.(map[string]interface{})
@ -255,8 +260,8 @@ func resourcePortFixedIpsV2(d *schema.ResourceData) []ports.IP {
IPAddress: rawMap["ip_address"].(string),
}
}
return ip
}
func resourcePortAdminStateUpV2(d *schema.ResourceData) *bool {