bug 8507: Generate usage event for empty snapshot

status 8507: resolved fixed
This commit is contained in:
kishan 2011-03-04 16:01:58 +05:30
parent 75def45063
commit 44ec214ad8
1 changed files with 2 additions and 0 deletions

View File

@ -243,6 +243,8 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
snapshot.setStatus(Snapshot.Status.BackedUp);
snapshot.setPrevSnapshotId(preId);
_snapshotDao.update(snapshotId, snapshot);
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_SNAPSHOT_CREATE, snapshot.getAccountId(), volume.getDataCenterId(), snapshotId, snapshot.getName(), null, null, volume.getSize());
_usageEventDao.persist(usageEvent);
} else {
long preSnapshotId = 0;
if( preSnapshotVO != null && preSnapshotVO.getBackupSnapshotId() != null) {