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 08:21:52 UTC

git commit: updated refs/heads/4.4-forward to 48646ae

Repository: cloudstack
Updated Branches:
  refs/heads/4.4-forward dc22566c6 -> 48646ae18


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/48646ae1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/48646ae1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/48646ae1

Branch: refs/heads/4.4-forward
Commit: 48646ae186eb75052da3da385404a823bd785444
Parents: dc22566
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 11:53:07 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/48646ae1/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 7107d65..c07d454 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -1740,7 +1740,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;