shwstppr commented on code in PR #8353:
URL: https://github.com/apache/cloudstack/pull/8353#discussion_r1427756641
##########
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:
@DaanHoogland I've done the refactor. Do you approve the changes?
--
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]