bug 9777: only allow to delete snapshot in BackedUp status

status 9777: resolved fixed
This commit is contained in:
anthony 2011-09-14 14:14:33 -07:00
parent 15302b03da
commit 313b624373

View File

@ -681,6 +681,9 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
if (snapshotCheck == null) {
throw new InvalidParameterValueException("unable to find a snapshot with id " + snapshotId);
}
if( !Status.BackedUp.equals(snapshotCheck.getStatus() ) ) {
throw new InvalidParameterValueException("Can't delete snapshotshot " + snapshotId + " due to it is not in BackedUp Status");
}
_accountMgr.checkAccess(caller, null, snapshotCheck);