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:
[email protected]
With regards,
Apache Git Services