fix: esxi server skus return empty results

This commit is contained in:
Qiu Jian
2019-04-20 17:57:58 +08:00
parent e17d857cc5
commit d8d73762a2
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -160,7 +160,7 @@ func (self *SCloudproviderregion) Detach(ctx context.Context, userCred mcclient.
func (manager *SCloudproviderregionManager) QueryRelatedRegionIds(cloudAccountId string, providerIds ...string) *sqlchemy.SSubQuery {
q := manager.Query("cloudregion_id")
if len(providerIds) > 0 {
if len(providerIds) > 0 {
q = q.Filter(sqlchemy.In(q.Field("cloudprovider_id"), providerIds))
}
+1 -1
View File
@@ -514,7 +514,7 @@ func providerFilter(q *sqlchemy.SQuery, provider string, public_cloud bool) *sql
if provider == "all" {
// provider 参数为all时。表示查询所有instance type.
return q
} else if len(provider) > 0 && !utils.IsInStringArray(provider, []string{api.CLOUD_PROVIDER_ONECLOUD, api.CLOUD_PROVIDER_VMWARE, "kvm"}) {
} else if len(provider) > 0 && !utils.IsInStringArray(provider, []string{api.CLOUD_PROVIDER_ONECLOUD, api.CLOUD_PROVIDER_VMWARE, "kvm", "esxi"}) {
q = q.Equals("provider", provider)
} else if public_cloud {
q = q.IsNotEmpty("provider")