Automatic merge from release/2.4.0 -> release/2.5.0

* commit '5445791c11a69cfaac310b985a1d7ec9dba8474b':
  capabilities 可用storage过滤
This commit is contained in:
邱剑
2019-01-03 17:09:50 +08:00
+4
View File
@@ -52,6 +52,8 @@ func getHypervisors(zone *SZone) []string {
q = q.Equals("zone_id", zone.Id)
}
q = q.IsNotEmpty("host_type").IsNotNull("host_type")
q = q.Equals("host_status", HOST_ONLINE)
q = q.IsTrue("enabled")
q = q.Distinct()
rows, err := q.Rows()
if err != nil {
@@ -76,6 +78,8 @@ func getStorageTypes(zone *SZone) []string {
}
q = q.IsNotEmpty("storage_type").IsNotNull("storage_type")
q = q.IsNotEmpty("medium_type").IsNotNull("medium_type")
q = q.In("status", []string{STORAGE_ENABLED, STORAGE_ONLINE})
q = q.IsTrue("enabled")
q = q.Distinct()
rows, err := q.Rows()
if err != nil {