GutoVeronezi commented on code in PR #6661:
URL: https://github.com/apache/cloudstack/pull/6661#discussion_r1053233971


##########
plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/provider/StorPoolHostListener.java:
##########
@@ -164,10 +163,25 @@ public boolean hostConnect(long hostId, long poolId) 
throws StorageConflictExcep
 
         StorPoolHelper.setSpClusterIdIfNeeded(hostId, 
mspAnswer.getClusterId(), clusterDao, hostDao, clusterDetailsDao);
 
-        log.info("Connection established between storage pool " + pool + " and 
host " + hostId);
+        StorPoolUtil.spLog("Connection established between storage pool [%s] 
and host [%s]", poolVO.getName(), host.getName());
         return true;
     }
 
+    private boolean isStorPoolVolumeOrStorageNotExistsOnHost(final Answer 
answer) {
+        return answer.getDetails().equals("objectDoesNotExist") || 
answer.getDetails().equals("spNotFound");

Review Comment:
   We could use `org.apache.commons.lang3.StringUtils` here:
   
   ```suggestion
           return StringUtils.equalsAny(answer.getDetails(), 
"objectDoesNotExist", "spNotFound");
   ```



##########
plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/driver/StorPoolPrimaryDataStoreDriver.java:
##########
@@ -682,9 +675,9 @@ public void copyAsync(DataObject srcData, DataObject 
dstData, AsyncCompletionCal
 
                         EndPoint ep = selector.select(srcData, dstData);
 
-                        if( ep == null) {
-                            StorPoolUtil.spLog("select(srcData, dstData) 
returned NULL. trying srcOnly");
-                            ep = selector.select(srcData); // Storpool is zone
+                        if( ep == null || 
storagePoolHostDao.findByPoolHost(dstData.getId(), ep.getId()) == null) {

Review Comment:
   ```suggestion
                           if (ep == null || 
storagePoolHostDao.findByPoolHost(dstData.getId(), ep.getId()) == null) {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to