mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-5272: return unlimit if max.account.* or max.project.* is set to negative
This commit is contained in:
parent
fe101f30a9
commit
888ddd724a
|
|
@ -280,6 +280,9 @@ public class ResourceLimitManagerImpl extends ManagerBase implements ResourceLim
|
|||
value = accountResourceLimitMap.get(type);
|
||||
}
|
||||
if (value != null) {
|
||||
if (value < 0) { // return unlimit if value is set to negative
|
||||
return max;
|
||||
}
|
||||
// convert the value from GiB to bytes in case of primary or secondary storage.
|
||||
if (type == ResourceType.primary_storage || type == ResourceType.secondary_storage) {
|
||||
value = value * ResourceType.bytesToGiB;
|
||||
|
|
@ -314,6 +317,9 @@ public class ResourceLimitManagerImpl extends ManagerBase implements ResourceLim
|
|||
value = accountResourceLimitMap.get(type);
|
||||
}
|
||||
if (value != null) {
|
||||
if (value < 0) { // return unlimit if value is set to negative
|
||||
return max;
|
||||
}
|
||||
if (type == ResourceType.primary_storage || type == ResourceType.secondary_storage) {
|
||||
value = value * ResourceType.bytesToGiB;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue