abh1sar commented on code in PR #8947:
URL: https://github.com/apache/cloudstack/pull/8947#discussion_r1577321600


##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -903,6 +918,20 @@ public PrimaryDataStoreInfo 
createPool(CreateStoragePoolCmd cmd) throws Resource
         }
 
         Map<String, String> details = extractApiParamAsMap(cmd.getDetails());
+        if (details.containsKey("nfsopts")) {
+            Long accountId = cmd.getEntityOwnerId();
+            if (!_accountMgr.isRootAdmin(accountId)) {

Review Comment:
   yes, it is not required here. Removed



##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -903,6 +918,20 @@ public PrimaryDataStoreInfo 
createPool(CreateStoragePoolCmd cmd) throws Resource
         }
 
         Map<String, String> details = extractApiParamAsMap(cmd.getDetails());
+        if (details.containsKey("nfsopts")) {
+            Long accountId = cmd.getEntityOwnerId();
+            if (!_accountMgr.isRootAdmin(accountId)) {
+                throw new PermissionDeniedException("Only root admin can set 
nfs options");
+            }
+            if (!hypervisorType.equals(HypervisorType.KVM) && 
!hypervisorType.equals(HypervisorType.Simulator)) {
+                throw new InvalidParameterValueException("NFS options can not 
be set for the hypervisor type " + hypervisorType);
+            }
+            if (!"nfs".equals(uriParams.get("scheme"))) {
+                throw new InvalidParameterValueException("NFS options can only 
be set on pool type " + StoragePoolType.NetworkFilesystem);
+            }
+            checkNfsOptions(details.get("nfsopts"));
+        }

Review Comment:
   Done



-- 
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: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to