weizhouapache commented on code in PR #8353: URL: https://github.com/apache/cloudstack/pull/8353#discussion_r1426683445
########## server/src/main/java/com/cloud/storage/StorageManagerImpl.java: ########## @@ -684,12 +685,19 @@ public boolean stop() { return true; } - private DataStore createLocalStorage(Map<String, Object> poolInfos) throws ConnectionException{ + protected DataStore createLocalStorage(Map<String, Object> poolInfos) throws ConnectionException{ Object existingUuid = poolInfos.get("uuid"); if( existingUuid == null ){ poolInfos.put("uuid", UUID.randomUUID().toString()); } - String hostAddress = poolInfos.get("host").toString(); + String hostAddress = poolInfos.get("host") == null ? null : poolInfos.get("host").toString(); + if (StringUtils.isEmpty(hostAddress)) { + throw new InvalidParameterValueException("Invalid host provided"); + } + String hostPath = poolInfos.get("hostPath") == null ? null : poolInfos.get("hostPath").toString(); + if (StringUtils.isEmpty(hostPath)) { + throw new InvalidParameterValueException("Invalid path provided"); + } Review Comment: on the other hand if there are too many methods and method hierarchies, it is not readable by humans. we need a tradeoff -- 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