mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-5272: return unlimit if max.account.* or max.project.* is set to negative
(cherry picked from commit 888ddd724a)
This commit is contained in:
parent
8970c95154
commit
3deb7dd6f5
|
|
@ -284,6 +284,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;
|
||||
|
|
@ -318,6 +321,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