Skip to content

Commit 985b2aa

Browse files
sanjaytripathiSateesh Chodapuneedi
authored andcommitted
CLOUDSTACK-2046: Primary Storage & Secondary Storage is max limit is set 0 with listResourceLimits API response as ROOT admin
Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
1 parent b12905b commit 985b2aa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎server/src/com/cloud/api/ApiResponseHelper.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public ResourceLimitResponse createResourceLimitResponse(ResourceLimit limit) {
379379
populateDomain(resourceLimitResponse, accountTemp.getDomainId());
380380
}
381381
resourceLimitResponse.setResourceType(Integer.valueOf(limit.getType().getOrdinal()).toString());
382-
if(limit.getType() == ResourceType.primary_storage || limit.getType() == ResourceType.secondary_storage) {
382+
if((limit.getType() == ResourceType.primary_storage || limit.getType() == ResourceType.secondary_storage) && limit.getMax() >= 0) {
383383
resourceLimitResponse.setMax((long) Math.ceil(limit.getMax()/ResourceType.bytesToGiB));
384384
} else {
385385
resourceLimitResponse.setMax(limit.getMax());

0 commit comments

Comments
 (0)