From 33d6f7a8c49c2edc7fdacaaf23e54751a9f914be Mon Sep 17 00:00:00 2001 From: Likitha Shetty Date: Tue, 16 Jul 2013 14:10:28 +0530 Subject: [PATCH] Revert "CLOUDSTACK-3293. DeleteAccount fails with ConstraintViolation on snapshot_store_ref." This reverts commit 22ddc3fa0644b9dae6bbbc6e87d425d11f574f30. --- .../cloud/storage/snapshot/SnapshotManagerImpl.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java index 2c9ef825cba..a67316f5a1e 100755 --- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -676,15 +676,7 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager, // Either way delete the snapshots for this volume. List snapshots = listSnapsforVolume(volumeId); for (SnapshotVO snapshot : snapshots) { - SnapshotVO snap = _snapshotDao.findById(snapshot.getId()); - SnapshotStrategy snapshotStrategy = null; - for (SnapshotStrategy strategy : snapshotStrategies) { - if (strategy.canHandle(snap)) { - snapshotStrategy = strategy; - break; - } - } - if (snapshotStrategy.deleteSnapshot(snapshot.getId())) { + if (_snapshotDao.expunge(snapshot.getId())) { if (snapshot.getRecurringType() == Type.MANUAL) { _resourceLimitMgr.decrementResourceCount(accountId, ResourceType.snapshot); _resourceLimitMgr.decrementResourceCount(accountId, ResourceType.secondary_storage,