mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-17 02:53:18 +01:00
bug 12607: fixed error message when resource limit exceeds
status 12607: resolved fixed
This commit is contained in:
parent
4cb293668d
commit
1fbff5bd05
@ -275,10 +275,10 @@ public class ResourceLimitManagerImpl implements ResourceLimitService, Manager{
|
|||||||
long accountLimit = findCorrectResourceLimitForAccount(account, type);
|
long accountLimit = findCorrectResourceLimitForAccount(account, type);
|
||||||
long potentialCount = _resourceCountDao.getResourceCount(account.getId(), ResourceOwnerType.Account, type) + numResources;
|
long potentialCount = _resourceCountDao.getResourceCount(account.getId(), ResourceOwnerType.Account, type) + numResources;
|
||||||
if (accountLimit != Resource.RESOURCE_UNLIMITED && potentialCount > accountLimit) {
|
if (accountLimit != Resource.RESOURCE_UNLIMITED && potentialCount > accountLimit) {
|
||||||
String message = "Maximum number of resources of type \"" + type + "\" for account name=" + account.getAccountName()
|
String message = "Maximum number of resources of type '" + type + "' for account name=" + account.getAccountName()
|
||||||
+ " in domain id=" + account.getDomainId() + " has been exceeded.";
|
+ " in domain id=" + account.getDomainId() + " has been exceeded.";
|
||||||
if (project != null) {
|
if (project != null) {
|
||||||
message = "Maximum number of resources of type \"" + type + "\" for project name=" + project.getName()
|
message = "Maximum number of resources of type '" + type + "' for project name=" + project.getName()
|
||||||
+ " in domain id=" + account.getDomainId() + " has been exceeded.";
|
+ " in domain id=" + account.getDomainId() + " has been exceeded.";
|
||||||
}
|
}
|
||||||
throw new ResourceAllocationException(message, type);
|
throw new ResourceAllocationException(message, type);
|
||||||
@ -298,7 +298,7 @@ public class ResourceLimitManagerImpl implements ResourceLimitService, Manager{
|
|||||||
if (domainLimit != null && domainLimit.getMax().longValue() != Resource.RESOURCE_UNLIMITED) {
|
if (domainLimit != null && domainLimit.getMax().longValue() != Resource.RESOURCE_UNLIMITED) {
|
||||||
long domainCount = _resourceCountDao.getResourceCount(domainId, ResourceOwnerType.Domain, type);
|
long domainCount = _resourceCountDao.getResourceCount(domainId, ResourceOwnerType.Domain, type);
|
||||||
if ((domainCount + numResources) > domainLimit.getMax().longValue()) {
|
if ((domainCount + numResources) > domainLimit.getMax().longValue()) {
|
||||||
throw new ResourceAllocationException("Maximum number of resources of type \"" + type + "\" for domain id=" + domainId + " has been exceeded.", type);
|
throw new ResourceAllocationException("Maximum number of resources of type '" + type + "' for domain id=" + domainId + " has been exceeded.", type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user