CLOUDSTACK-2932

Allow deleting of snapshots that have errored out. Simply mark the removed column as there is no physiocal clean up required
This commit is contained in:
Nitin Mehta 2013-06-11 15:39:14 +05:30
parent 7b63894a0a
commit 07e5cbe813

View File

@ -536,6 +536,11 @@ public class AncientSnapshotStrategy implements SnapshotStrategy {
Long snapshotId = snapInfo.getId(); Long snapshotId = snapInfo.getId();
SnapshotObject snapshot = (SnapshotObject)snapInfo; SnapshotObject snapshot = (SnapshotObject)snapInfo;
if (Snapshot.State.Error.equals(snapshot.getState())) {
_snapshotDao.remove(snapshotId);
return true;
}
if (!Snapshot.State.BackedUp.equals(snapshot.getState())) { if (!Snapshot.State.BackedUp.equals(snapshot.getState())) {
throw new InvalidParameterValueException("Can't delete snapshotshot " + snapshotId + " due to it is not in BackedUp Status"); throw new InvalidParameterValueException("Can't delete snapshotshot " + snapshotId + " due to it is not in BackedUp Status");
} }