bug 12571: fixed error message in createSnapshotPolicy

status 12571: resolved fixed
This commit is contained in:
Alena Prokharchyk 2012-01-20 14:31:38 -08:00
parent 8bcf30da85
commit 79e9e292dd
1 changed files with 6 additions and 1 deletions

View File

@ -1107,7 +1107,12 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
long domainLimit = _resourceLimitMgr.findCorrectResourceLimitForDomain(_domainMgr.getDomain(owner.getDomainId()), ResourceType.snapshot);
int max = cmd.getMaxSnaps().intValue();
if (owner.getType() != Account.ACCOUNT_TYPE_ADMIN && ((accountLimit != -1 && max > accountLimit) || (domainLimit != -1 && max > domainLimit))) {
throw new InvalidParameterValueException("Max number of snapshots shouldn't exceed the domain/account level snapshot limit");
String message = "domain/account";
if (owner.getType() == Account.ACCOUNT_TYPE_PROJECT) {
message = "domain/project";
}
throw new InvalidParameterValueException("Max number of snapshots shouldn't exceed the " + message + " level snapshot limit");
}
SnapshotPolicyVO policy = _snapshotPolicyDao.findOneByVolumeInterval(volumeId, intvType);