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>
This commit is contained in:
Sanjay Tripathi 2013-04-17 12:03:47 +05:30 committed by Sateesh Chodapuneedi
parent b12905b7a8
commit 985b2aa88d

View File

@ -379,7 +379,7 @@ public class ApiResponseHelper implements ResponseGenerator {
populateDomain(resourceLimitResponse, accountTemp.getDomainId());
}
resourceLimitResponse.setResourceType(Integer.valueOf(limit.getType().getOrdinal()).toString());
if(limit.getType() == ResourceType.primary_storage || limit.getType() == ResourceType.secondary_storage) {
if((limit.getType() == ResourceType.primary_storage || limit.getType() == ResourceType.secondary_storage) && limit.getMax() >= 0) {
resourceLimitResponse.setMax((long) Math.ceil(limit.getMax()/ResourceType.bytesToGiB));
} else {
resourceLimitResponse.setMax(limit.getMax());