Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
Fix port-create bug
Browse files Browse the repository at this point in the history
  • Loading branch information
feiskyer committed Apr 25, 2016
1 parent 7d71204 commit 54df67a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions openstack/networking/v2/ports/requests.go
Expand Up @@ -102,10 +102,10 @@ type CreateOpts struct {
FixedIPs interface{}
DeviceID string
DeviceOwner string
DNSName string
DNSName string
TenantID string
SecurityGroups []string
HostID string
HostID string
AllowedAddressPairs []AddressPair
}

Expand Down Expand Up @@ -147,6 +147,7 @@ func (opts CreateOpts) ToPortCreateMap() (map[string]interface{}, error) {
}
if opts.AllowedAddressPairs != nil {
p["allowed_address_pairs"] = opts.AllowedAddressPairs
}
if opts.HostID != "" {
p["binding:host_id"] = opts.HostID
}
Expand Down Expand Up @@ -185,8 +186,8 @@ type UpdateOpts struct {
DeviceID string
DeviceOwner string
SecurityGroups []string
DNSName string
HostID string
DNSName string
HostID string
AllowedAddressPairs []AddressPair
}

Expand Down Expand Up @@ -217,6 +218,7 @@ func (opts UpdateOpts) ToPortUpdateMap() (map[string]interface{}, error) {
}
if opts.AllowedAddressPairs != nil {
p["allowed_address_pairs"] = opts.AllowedAddressPairs
}
if opts.HostID != "" {
p["binding:host_id"] = opts.HostID
}
Expand Down

0 comments on commit 54df67a

Please sign in to comment.