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

    https://github.com/apache/cloudstack/pull/1441#discussion_r56768712
  
    --- Diff: 
engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java
 ---
    @@ -440,41 +400,28 @@ private void markAsBackedUp(SnapshotObject 
snapshotObj) {
     
         @Override
         public StrategyPriority canHandle(Snapshot snapshot, SnapshotOperation 
op) {
    -        long volumeId = snapshot.getVolumeId();
    -        VolumeVO volumeVO = _volumeDao.findById(volumeId);
             if (SnapshotOperation.REVERT.equals(op)) {
    -            if (volumeVO != null && 
ImageFormat.QCOW2.equals(volumeVO.getFormat()))
    -                return StrategyPriority.DEFAULT;
    -            else
    -                return StrategyPriority.CANT_HANDLE;
    +            return StrategyPriority.CANT_HANDLE;
             }
     
    --- End diff --
    
    Good work on rewritting the logic to a slimmer state.
    
    Wouldn't be it more readable if you turn lines 407-422 into a boolean 
function which would return true if "supportsStorageSystemSnapshots". Snap this 
chunk of code could prove useful on creating unit tests and documentation as 
this segment clearly aims to check this condition solely.


---
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