Updated Branches: refs/heads/4.3 8970c9515 -> 895e581e7
CLOUDSTACK-5272: return unlimit if max.account.* or max.project.* is set to negative (cherry picked from commit 888ddd724aabbd22d675fe2bba873971888e1a8a) Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3deb7dd6 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3deb7dd6 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3deb7dd6 Branch: refs/heads/4.3 Commit: 3deb7dd6f5dd6c8df42a8ada425300018b656e97 Parents: 8970c95 Author: Wei Zhou <[email protected]> Authored: Tue Nov 26 14:05:18 2013 +0100 Committer: Wei Zhou <[email protected]> Committed: Tue Nov 26 14:26:01 2013 +0100 ---------------------------------------------------------------------- .../src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3deb7dd6/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java b/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java index 7417754..269f04f 100755 --- a/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java +++ b/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java @@ -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; }
