sureshanaparti commented on a change in pull request #5382:
URL: https://github.com/apache/cloudstack/pull/5382#discussion_r698256812
##########
File path: server/src/main/java/com/cloud/storage/StorageManagerImpl.java
##########
@@ -1834,6 +1836,42 @@ public void syncDatastoreClusterStoragePool(long
datastoreClusterPoolId, List<Mo
handleRemoveChildStoragePoolFromDatastoreCluster(childDatastoreUUIDs);
}
+ /**
+ * fixed mismatching between db uuids and and custom
+ * attribute uuids
+ *
+ * To different formats of uuids exists
+ * 1. xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ * 2. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @param uuid of existing pool
+ * @return existing pull or null otherwise
+ */
+ private StoragePoolVO getExistingPoolByUuid(String uuid){
+ StoragePoolVO storagePool = _storagePoolDao.findByUuid(uuid);
+ if(storagePool != null){
+ return storagePool;
+ }
+
+ //this case is unlikely (DB uuid without separators), but safety first
Review comment:
@DK101010 I feel it is not correct to find the pool with the mismatched
UUID (by removing the separators).
the UUIDs format in DB should be always with separators
(`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`). It is better to fix if there is any
mismatch / discrepancy in populating the UUIDs anywhere.
--
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]