[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-9297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15203402#comment-15203402
 ] 

ASF GitHub Bot commented on CLOUDSTACK-9297:
--------------------------------------------

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.


> delete snapshot without id is failing with Unable to determine the storage 
> pool of the snapshot
> -----------------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-9297
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9297
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: API
>    Affects Versions: 4.7.0, 4.8.0
>         Environment: Ubuntu 14.04.3 management + kvm
>            Reporter: Özhan Rüzgar Karaman
>            Assignee: Mike Tutkowski
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to