mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 18:43:26 +01:00
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
3adeb12d2f
commit
abfc351b78
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user