You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sa...@apache.org on 2014/06/27 12:27:08 UTC

[2/2] git commit: updated refs/heads/master to 69e86cb

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


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/28505c27
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/28505c27
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/28505c27

Branch: refs/heads/master
Commit: 28505c2729cdbf8b2847661c699ec8b90a360ed6
Parents: 71f76ed
Author: Sanjay Tripathi <sa...@citrix.com>
Authored: Fri Jun 27 11:53:07 2014 +0530
Committer: Sanjay Tripathi <sa...@citrix.com>
Committed: Fri Jun 27 15:58:42 2014 +0530

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiResponseHelper.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/28505c27/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index d454774..ed48d0b 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -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;