bug 7965: Added delete event for recurring snapshot delete

status 7965: resolved fixed
This commit is contained in:
kishan 2011-02-02 17:43:03 +05:30
parent 86398a8546
commit d901d42670

View File

@ -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;
}