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:13:16 UTC

git commit: updated refs/heads/4.2 to bfd32ca

Updated Branches:
  refs/heads/4.2 9b7bee0e8 -> bfd32ca8f


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

Branch: refs/heads/4.2
Commit: bfd32ca8ff1dfbb5c574dd07991c4988bba942e6
Parents: 9b7bee0
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 15:53:20 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/bfd32ca8/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 8e324bc..d32441c 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -2275,24 +2275,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