From d901d426705795842fa176a06efb5bd40ac372d9 Mon Sep 17 00:00:00 2001 From: kishan Date: Wed, 2 Feb 2011 17:43:03 +0530 Subject: [PATCH] bug 7965: Added delete event for recurring snapshot delete status 7965: resolved fixed --- .../com/cloud/storage/snapshot/SnapshotManagerImpl.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java index ce3a1e794c3..fb9ec416401 100755 --- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -697,7 +697,10 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma s_logger.debug("Calling deleteSnapshot for snapshotId: " + snapshotId + " and policyId " + policyId); } SnapshotVO lastSnapshot = null; + SnapshotVO snapshot = _snapshotDao.findById(snapshotId); _snapshotDao.remove(snapshotId); + UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_SNAPSHOT_DELETE, snapshot.getAccountId(), 0L, snapshotId, snapshot.getName(), null, null, 0L); + _usageEventDao.persist(usageEvent); long lastId = snapshotId; boolean destroy = false; while( true ) { @@ -789,11 +792,6 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma s_logger.error(details); } - if(success){ - UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_SNAPSHOT_DELETE, snapshot.getAccountId(), volume.getDataCenterId(), snapshotId, snapshot.getName(), null, null, volume.getSize()); - _usageEventDao.persist(usageEvent); - } - return success; }