mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-3293. DeleteAccount fails with ConstraintViolation on snapshot_store_ref.
This commit is contained in:
parent
1c43c95767
commit
22ddc3fa06
@ -676,7 +676,15 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
|
||||
// Either way delete the snapshots for this volume.
|
||||
List<SnapshotVO> snapshots = listSnapsforVolume(volumeId);
|
||||
for (SnapshotVO snapshot : snapshots) {
|
||||
if (_snapshotDao.expunge(snapshot.getId())) {
|
||||
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 (snapshot.getRecurringType() == Type.MANUAL) {
|
||||
_resourceLimitMgr.decrementResourceCount(accountId, ResourceType.snapshot);
|
||||
_resourceLimitMgr.decrementResourceCount(accountId, ResourceType.secondary_storage,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user