shwstppr commented on code in PR #8142:
URL: https://github.com/apache/cloudstack/pull/8142#discussion_r1384752623


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java:
##########
@@ -294,12 +294,14 @@ public KVMStoragePool getStoragePoolByURI(String uri) {
         String uuid = null;
         String sourceHost = "";
         StoragePoolType protocol = null;
-        if (storageUri.getScheme().equalsIgnoreCase("nfs") || 
storageUri.getScheme().equalsIgnoreCase("NetworkFilesystem")) {
+        final String scheme = storageUri.getScheme().toLowerCase();
+        List<String> acceptedSchemes = List.of("nfs", "networkfilesystem", 
"filesystem");
+        if (acceptedSchemes.contains(scheme)) {

Review Comment:
   Line 297 should take care of that



##########
engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java:
##########
@@ -217,20 +216,23 @@ private Long 
getOneMatchingPoolIdFromRefs(List<VMTemplateStoragePoolVO> existing
                 }
             }
         }
-        return null;
+        return pools.get(0).getId();
     }
 
     /**
-     * Retrieve storage pools with scope = cluster or zone matching clusterId 
or dataCenterId depending on their scope
+     * Retrieve storage pools with scope = cluster or zone or local matching 
clusterId or dataCenterId or hostId depending on their scope
      */
-    private List<StoragePoolVO> getStoragePoolsFromClusterOrZone(Long 
clusterId, long dataCenterId, Hypervisor.HypervisorType hypervisorType) {
+    private List<StoragePoolVO> getStoragePoolsFromClusterOrZoneOrLocal(Long 
clusterId, long dataCenterId, Hypervisor.HypervisorType hypervisorType, long 
hostId) {

Review Comment:
   Done



##########
engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java:
##########
@@ -204,11 +205,9 @@ public List<TemplateInfo> listTemplateOnCache(long 
templateId) {
      */
     private Long getOneMatchingPoolIdFromRefs(List<VMTemplateStoragePoolVO> 
existingRefs, List<StoragePoolVO> pools) {
         if (pools.isEmpty()) {
-            throw new CloudRuntimeException("No storage pools found");
+            return null;

Review Comment:
   Refactored



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