Updated Branches: refs/heads/master 7b63894a0 -> 07e5cbe81
CLOUDSTACK-2932 Allow deleting of snapshots that have errored out. Simply mark the removed column as there is no physiocal clean up required Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/07e5cbe8 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/07e5cbe8 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/07e5cbe8 Branch: refs/heads/master Commit: 07e5cbe81394fbd4e36d5ad2fff36cd8eea40a8e Parents: 7b63894 Author: Nitin Mehta <[email protected]> Authored: Tue Jun 11 15:39:14 2013 +0530 Committer: Nitin Mehta <[email protected]> Committed: Tue Jun 11 16:23:21 2013 +0530 ---------------------------------------------------------------------- .../storage/snapshot/strategy/AncientSnapshotStrategy.java | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07e5cbe8/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/AncientSnapshotStrategy.java ---------------------------------------------------------------------- diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/AncientSnapshotStrategy.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/AncientSnapshotStrategy.java index 9e666d2..4aba3d9 100644 --- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/AncientSnapshotStrategy.java +++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/AncientSnapshotStrategy.java @@ -536,6 +536,11 @@ public class AncientSnapshotStrategy implements SnapshotStrategy { Long snapshotId = snapInfo.getId(); SnapshotObject snapshot = (SnapshotObject)snapInfo; + if (Snapshot.State.Error.equals(snapshot.getState())) { + _snapshotDao.remove(snapshotId); + return true; + } + if (!Snapshot.State.BackedUp.equals(snapshot.getState())) { throw new InvalidParameterValueException("Can't delete snapshotshot " + snapshotId + " due to it is not in BackedUp Status"); }
