Skip to content

Commit

Permalink
fix: 过滤可用eip
Browse files Browse the repository at this point in the history
  • Loading branch information
Qu Xuan committed Jul 17, 2020
1 parent 5cd0873 commit 23e17fe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/compute/models/elasticips.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ func (manager *SElasticipManager) ListItemFilter(
sq := networks.Query(networks.Field("id")).Join(wires, sqlchemy.Equals(wires.Field("id"), networks.Field("wire_id"))).
Filter(sqlchemy.Equals(wires.Field("zone_id"), zone.Id)).SubQuery()
q = q.Filter(sqlchemy.In(q.Field("network_id"), sq))
gns := GuestnetworkManager.Query("network_id").Equals("guest_id", guest.Id).SubQuery()
q = q.Filter(sqlchemy.NotIn(q.Field("network_id"), gns))
} else {
region := guest.getRegion()
q = q.Equals("cloudregion_id", region.Id)
Expand Down

0 comments on commit 23e17fe

Please sign in to comment.