mirror of https://github.com/apache/cloudstack.git
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.
This commit is contained in:
parent
9b7bee0e85
commit
bfd32ca8ff
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue