From a5241c89c7bf123fa577b4eedc0027d44b160fb3 Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Thu, 6 Sep 2012 16:15:56 +0530 Subject: [PATCH] CS-11945: Allow deleting of snapshots that have errored out. Simply mark the removed column as there is no physiocal clean up required Reviewed-by: Kishan --- .../src/com/cloud/storage/snapshot/SnapshotManagerImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java index aeac977cc75..52e52c1e708 100755 --- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -692,6 +692,10 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma if (snapshotCheck == null) { throw new InvalidParameterValueException("unable to find a snapshot with id " + snapshotId); } + if( Status.Error.equals(snapshotCheck.getStatus() ) ) { + _snapshotDao.remove(snapshotId); + return true; + } if( !Status.BackedUp.equals(snapshotCheck.getStatus() ) ) { throw new InvalidParameterValueException("Can't delete snapshotshot " + snapshotId + " due to it is not in BackedUp Status"); }