You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pr...@apache.org on 2013/07/28 01:25:35 UTC

git commit: updated refs/heads/master to abfc351

Updated Branches:
  refs/heads/master 3adeb12d2 -> abfc351b7


CLOUDSTACK-3814 Duplicate entry for CPU, Public ip address in dashboard

Changes:
- ListCapacity API was searching the capacities per zone, pod and cluster causing duplicates to end up in th result.
- Instead we should group by zone if zone and pod both are null. Group by pod if zone is provided but no pod. Or group by cluster when zone and pod both are provided.


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

Branch: refs/heads/master
Commit: abfc351b783e4aa0bfc360979de54dbea67cf538
Parents: 3adeb12
Author: Prachi Damle <pr...@cloud.com>
Authored: Sat Jul 27 15:52:35 2013 -0700
Committer: Prachi Damle <pr...@cloud.com>
Committed: Sat Jul 27 16:24:48 2013 -0700

----------------------------------------------------------------------
 .../com/cloud/server/ManagementServerImpl.java   | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/abfc351b/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index ecb8f85..e0abe01 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -2292,24 +2292,23 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
             if (summedCapacitiesAtZone != null) {
                 summedCapacities.addAll(summedCapacitiesAtZone);
             }
-        }
-        if (podId == null) {// Group by Pod, capacity type
+        } else if (podId == null) {// Group by Pod, capacity type
             List<SummedCapacity> summedCapacitiesAtPod = _capacityDao.listCapacitiesGroupedByLevelAndType(capacityType, zoneId, podId, clusterId, 2,
                     cmd.getPageSizeVal());
             if (summedCapacitiesAtPod != null) {
                 summedCapacities.addAll(summedCapacitiesAtPod);
             }
-            List<SummedCapacity> summedCapacitiesForSecStorage = getSecStorageUsed(zoneId, capacityType);
-            if (summedCapacitiesForSecStorage != null) {
-                summedCapacities.addAll(summedCapacitiesForSecStorage);
+        } else { // Group by Cluster, capacity type
+            List<SummedCapacity> summedCapacitiesAtCluster = _capacityDao.listCapacitiesGroupedByLevelAndType(
+                    capacityType, zoneId, podId, clusterId, 3, cmd.getPageSizeVal());
+            if (summedCapacitiesAtCluster != null) {
+                summedCapacities.addAll(summedCapacitiesAtCluster);
             }
         }
 
-        // Group by Cluster, capacity type
-        List<SummedCapacity> summedCapacitiesAtCluster = _capacityDao.listCapacitiesGroupedByLevelAndType(capacityType, zoneId, podId, clusterId, 3,
-                cmd.getPageSizeVal());
-        if (summedCapacitiesAtCluster != null) {
-            summedCapacities.addAll(summedCapacitiesAtCluster);
+        List<SummedCapacity> summedCapacitiesForSecStorage = getSecStorageUsed(zoneId, capacityType);
+        if (summedCapacitiesForSecStorage != null) {
+            summedCapacities.addAll(summedCapacitiesForSecStorage);
         }
 
         // Sort Capacities