GutoVeronezi commented on a change in pull request #5382:
URL: https://github.com/apache/cloudstack/pull/5382#discussion_r714766992



##########
File path: server/src/main/java/com/cloud/storage/StorageManagerImpl.java
##########
@@ -1834,6 +1836,17 @@ public void syncDatastoreClusterStoragePool(long 
datastoreClusterPoolId, List<Mo
         handleRemoveChildStoragePoolFromDatastoreCluster(childDatastoreUUIDs);
     }
 
+    private StoragePoolVO getExistingPoolByUuid(String uuid){
+        if(!uuid.contains("-")){

Review comment:
       What I meant:
   
   ```java
   private StoragePoolVO getExistingPoolByUuid(String uuid){
       if (uuid.contains("-")) {
           return _storagePoolDao.findByUuid(uuid);
       }
       
       UUID poolUuid = new UUID(
           new BigInteger(uuid.substring(0, 16), 16).longValue(),
           new BigInteger(uuid.substring(16), 16).longValue()
       );
       uuid = poolUuid.toString();
       return _storagePoolDao.findByUuid(uuid);
   }
   ``` 
   
   or
   
   ```java
   private StoragePoolVO getExistingPoolByUuid(String uuid){
       if (uuid.contains("-")) {
           return _storagePoolDao.findByUuid(uuid);
       }
       
       uuid = new UUID(
           new BigInteger(uuid.substring(0, 16), 16).longValue(),
           new BigInteger(uuid.substring(16), 16).longValue()
       ).toString();
   
       return _storagePoolDao.findByUuid(uuid);
   }
   ```




-- 
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