Compare commits

..

4 Commits

Author SHA1 Message Date
Zexi Li
4e7af6e2e7 Merge pull request #7227 from ioito/automated-cherry-pick-of-#7224-upstream-release-3.2
Automated cherry pick of #7224: fix: 过滤可用eip
2020-07-17 20:25:04 +08:00
Zexi Li
df8982747a Merge pull request #7223 from ioito/automated-cherry-pick-of-#7221-upstream-release-3.2
Automated cherry pick of #7221: fix: 避免乌兰察布区域拉取资源异常
2020-07-17 20:24:05 +08:00
Qu Xuan
08c836ad1c fix: 过滤可用eip 2020-07-17 20:16:54 +08:00
Qu Xuan
5a47ca5da4 fix: 避免乌兰察布区域拉取资源异常 2020-07-17 18:53:20 +08:00
2 changed files with 9 additions and 1 deletions

View File

@@ -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)

View File

@@ -43,6 +43,8 @@ type SRegion struct {
RegionId string
LocalName string
RegionEndpoint string
izones []cloudprovider.ICloudZone
ivpcs []cloudprovider.ICloudVpc
@@ -105,7 +107,11 @@ func (self *SRegion) ecsRequest(apiName string, params map[string]string) (jsonu
if err != nil {
return nil, err
}
return jsonRequest(client, "ecs.aliyuncs.com", ALIYUN_API_VERSION, apiName, params, self.client.debug)
endpoint := self.RegionEndpoint
if len(endpoint) == 0 {
endpoint = "ecs.aliyuncs.com"
}
return jsonRequest(client, endpoint, ALIYUN_API_VERSION, apiName, params, self.client.debug)
}
func (self *SRegion) rdsRequest(apiName string, params map[string]string) (jsonutils.JSONObject, error) {