fix(region): gpu_models in capabilities' response

This commit is contained in:
Zexi Li
2022-09-08 13:04:46 +08:00
parent fd1e30f4fc
commit 9b14edfc9c
+1
View File
@@ -743,6 +743,7 @@ func getGPUs(region *SCloudregion, zone *SZone, domainId string) []string {
hosts := hostQuery.SubQuery()
q := devices.Query(devices.Field("model"))
q = q.Startswith("dev_type", "GPU")
if region != nil {
subq := getRegionZoneSubq(region)
q = q.Join(hosts, sqlchemy.Equals(devices.Field("host_id"), hosts.Field("id")))