Github user jburwell commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1740#discussion_r87913074
  
    --- Diff: server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ---
    @@ -1111,6 +1111,20 @@ public boolean canOperateOnVolume(Volume volume) {
         }
     
         @Override
    +    public void cleanupSnapshotsByVolume(Long volumeId) {
    +        List<SnapshotVO> volSnapShots = 
_snapshotDao.listByVolumeId(volumeId);
    +        for(SnapshotVO snapshot: volSnapShots) {
    +            SnapshotInfo info = 
snapshotFactory.getSnapshot(snapshot.getId(), DataStoreRole.Primary);
    +            try {
    +                snapshotSrv.deleteSnapshot(info);
    +            } catch(CloudRuntimeException e) {
    +                String msg = "Cleanup of Snapshot with uuid " + 
snapshot.getUuid() + " in primary storage is failed. Ignoring";
    --- End diff --
    
    This local variable is only used once.  Please consider collapsing into 
lint 1122.  Also, please add the message from the exception to the message to 
provide greater detail for debugging efforts.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to