From 79e9e292ddb94f0f07fa47fe1f8d0e1776e2658b Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Fri, 20 Jan 2012 14:31:38 -0800 Subject: [PATCH] bug 12571: fixed error message in createSnapshotPolicy status 12571: resolved fixed --- .../com/cloud/storage/snapshot/SnapshotManagerImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java index bc5da09be8c..2225f38b775 100755 --- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -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);