rafaelweingartner commented on a change in pull request #1740: CLOUDSTACK-9572 
Snapshot on primary storage not cleaned up after Stor?
URL: https://github.com/apache/cloudstack/pull/1740#discussion_r158788814
 
 

 ##########
 File path: server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
 ##########
 @@ -1331,6 +1331,21 @@ public boolean canOperateOnVolume(Volume volume) {
         return true;
     }
 
+    @Override
+    public void cleanupSnapshotsByVolume(Long volumeId) {
+        List<SnapshotInfo> infos = snapshotFactory.getSnapshots(volumeId, 
DataStoreRole.Primary);
+        for(SnapshotInfo info: infos) {
+            try {
+               if(info != null) {
 
 Review comment:
   Do you need this null check?
   This only happen if one uses the `set` method of List object to replace a 
position with a `Null` value

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to