mike-tutkowski commented on issue #2298: CLOUDSTACK-9620: Enhancements for 
managed storage
URL: https://github.com/apache/cloudstack/pull/2298#issuecomment-355670187
 
 
   @rafaelweingartner I went ahead and updated it to the following:
   
       private void handleCopyAsyncForSnapshotToVolume(boolean canHandleSrc, 
SnapshotInfo srcSnapshotInfo, VolumeInfo destVolumeInfo,
                                                       
AsyncCompletionCallback<CopyCommandResult> callback) {
           boolean canHandleDest = canHandle(destVolumeInfo);
   
           if (canHandleSrc && canHandleDest) {
               if (srcSnapshotInfo.getDataStore().getId() == 
destVolumeInfo.getDataStore().getId()) {
                   
handleCreateVolumeFromSnapshotBothOnStorageSystem(srcSnapshotInfo, 
destVolumeInfo, callback);
               } else {
                   String errMsg = "To perform this operation, the source and 
destination primary storages must be the same.";
   
                   handleError(errMsg, callback);
               }
           } else if (canHandleDest) {
               
handleCreateVolumeFromSnapshotOnSecondaryStorage(srcSnapshotInfo, 
destVolumeInfo, callback);
           }
           else {
               handleError(OPERATION_NOT_SUPPORTED, callback);
           }
       }
   
   Basically, the code needs to throw an exception in two cases: [if both 
canHandleSrc and canHandleDest are false] or [if canHandleSrc is true, but 
canHandleDest is false].

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to