You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/01/04 11:53:39 UTC

[GitHub] rafaelweingartner commented on a change in pull request #2298: CLOUDSTACK-9620: Enhancements for managed storage

rafaelweingartner commented on a change in pull request #2298: CLOUDSTACK-9620: Enhancements for managed storage
URL: https://github.com/apache/cloudstack/pull/2298#discussion_r159635940
 
 

 ##########
 File path: engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
 ##########
 @@ -226,10 +310,12 @@ public void copyAsync(DataObject srcData, DataObject destData, Host destHost, As
 
                 if (canHandleSrc) {
                     String errMsg = "This operation is not supported (DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT " +
-                            "not supported by source storage plug-in). " + getSrcDataStoreMsg(srcData);
+                            "not supported by source storage plug-in). " + getDestDataStoreMsg(destData);
 
 Review comment:
   This is a funny cause. I get amused imagining the thought process of a person that code these things...
   Documentation could help. However, I would first suggesting extracting lines 191-227 to a method. Then, instead of starting with `if (canHandleSrc && canHandleDest)`, you can do the following:
   if (!canHandleSrc){Throw exception regarding source not being able to handle the request}
   if (!canHandleDest){Throw exception regarding destination not being able to handle the request }
   
   Then, if you pass those two IFs, you do not need a third one to check `if (canHandleSrc && canHandleDest)`

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services