CLOUDSTACK-6884: List Capacity API always returns GPU capacity also even if type is different.

This commit is contained in:
Sanjay Tripathi 2014-06-27 11:53:07 +05:30
parent 71f76edf71
commit 28505c2729

View File

@ -1472,7 +1472,7 @@ public class ApiResponseHelper implements ResponseGenerator {
}
List<VgpuTypesInfo> gpuCapacities;
if (!result.isEmpty() && (gpuCapacities = ApiDBUtils.getGpuCapacites(result.get(0).getDataCenterId(), result.get(0).getPodId(), result.get(0).getClusterId())) != null) {
if (result.size() > 1 && (gpuCapacities = ApiDBUtils.getGpuCapacites(result.get(0).getDataCenterId(), result.get(0).getPodId(), result.get(0).getClusterId())) != null) {
HashMap<String, Long> vgpuVMs = ApiDBUtils.getVgpuVmsCount(result.get(0).getDataCenterId(), result.get(0).getPodId(), result.get(0).getClusterId());
float capacityUsed = 0;