Skip to content

Commit

Permalink
Merge pull request #4617 from ebsco/master
Browse files Browse the repository at this point in the history
Fix to not put fixed_ip in request if not defined
  • Loading branch information
jtopjian committed Jan 11, 2016
2 parents 84014ed + 1de2fde commit f1b55de
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand All @@ -255,8 +260,8 @@ func resourcePortFixedIpsV2(d *schema.ResourceData) []ports.IP {
IPAddress: rawMap["ip_address"].(string),
}
}

return ip

}

func resourcePortAdminStateUpV2(d *schema.ResourceData) *bool {
Expand Down

0 comments on commit f1b55de

Please sign in to comment.