mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 8151: Avoid volume delete event for volumes which were never attached
status 8151: resolved fixed
This commit is contained in:
parent
6550f0a63b
commit
e74d8888c7
@ -1530,9 +1530,11 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
||||
_volsDao.update(volume, Volume.Event.Destroy);
|
||||
long volumeId = volume.getId();
|
||||
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VOLUME_DELETE, volume.getAccountId(), volume.getDataCenterId(), volumeId,
|
||||
volume.getName(), null, null, null);
|
||||
_usageEventDao.persist(usageEvent);
|
||||
if(volume.getPoolId() != null){
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VOLUME_DELETE, volume.getAccountId(), volume.getDataCenterId(), volumeId,
|
||||
volume.getName(), null, null, null);
|
||||
_usageEventDao.persist(usageEvent);
|
||||
}
|
||||
|
||||
// Delete the recurring snapshot policies for this volume.
|
||||
_snapshotMgr.deletePoliciesForVolume(volumeId);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user