abh1sar commented on code in PR #8947: URL: https://github.com/apache/cloudstack/pull/8947#discussion_r1576908083
########## server/src/main/java/com/cloud/storage/StorageManagerImpl.java: ########## @@ -839,6 +839,21 @@ protected String createLocalStoragePoolName(Host host, StoragePoolInfo storagePo return String.format("%s-%s-%s", StringUtils.trim(host.getName()), "local", storagePoolInformation.getUuid().split("-")[0]); } + protected void checkNfsOptions(String nfsopts) throws InvalidParameterValueException { + String[] options = nfsopts.replaceAll("\\s", "").split(","); + Map<String, String> optionsMap = new HashMap<>(); + for (String option : options) { + String[] keyValue = option.split("="); + if (keyValue.length > 2) { + throw new InvalidParameterValueException("Invalid value for NFS option " + keyValue[0]); + } + if (optionsMap.containsKey(keyValue[0])) { + throw new InvalidParameterValueException("Duplicate NFS option values found for option " + keyValue[0]); + } + optionsMap.put(keyValue[0], null); Review Comment: Don't want to perform validations on any mount options as idea is to leave it to the admin if they are using the correct options are not. Cloudstack is only providing the functionality to add options. We can give an indication that this feature is tested with two mount options (`vers` and `nconnect`). But I am thinking that admin can give even more mount options if they desire to do so. That way we don't have to make any changes for supporting more options. -- 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