From d6af51a402b7d3f8a62a63bf27028550915a7f79 Mon Sep 17 00:00:00 2001 From: anthony Date: Wed, 14 Sep 2011 14:14:33 -0700 Subject: [PATCH] bug 9777: only allow to delete snapshot in BackedUp status status 9777: resolved fixed --- server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java index ddd2ca0cc9b..fd1f9846d85 100755 --- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -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);