Merge branch '4.19' into 4.20

This commit is contained in:
Suresh Kumar Anaparti 2025-07-30 18:14:58 +05:30
commit 7e0414354a
No known key found for this signature in database
GPG Key ID: D7CEAE3A9E71D0AA

View File

@ -132,14 +132,16 @@ public class ListCapacityCmd extends BaseListCmd {
Collections.sort(capacityResponses, new Comparator<CapacityResponse>() { Collections.sort(capacityResponses, new Comparator<CapacityResponse>() {
public int compare(CapacityResponse resp1, CapacityResponse resp2) { public int compare(CapacityResponse resp1, CapacityResponse resp2) {
int res = resp1.getZoneName().compareTo(resp2.getZoneName()); int res = resp1.getZoneName().compareTo(resp2.getZoneName());
// Group by zone
if (res != 0) { if (res != 0) {
return res; return res;
} else {
return resp1.getCapacityType().compareTo(resp2.getCapacityType());
} }
// Sort by capacity type only if not already sorted by usage
return (getSortBy() != null) ? 0 : resp1.getCapacityType().compareTo(resp2.getCapacityType());
} }
}); });
response.setResponses(capacityResponses); response.setResponses(capacityResponses);
response.setResponseName(getCommandName()); response.setResponseName(getCommandName());
this.setResponseObject(response); this.setResponseObject(response);