sureshanaparti commented on a change in pull request #4794:
URL: https://github.com/apache/cloudstack/pull/4794#discussion_r594327672
##########
File path: server/src/main/java/com/cloud/template/TemplateManagerImpl.java
##########
@@ -1936,7 +1937,12 @@ public VMTemplateVO
createPrivateTemplateRecord(CreateTemplateCmd cmd, Account t
UserVmVO userVm = _userVmDao.findById(vmId);
if (userVm != null) {
_userVmDao.loadDetails(userVm);
- details.putAll(userVm.getDetails());
+ Map<String, String> vmDetails = userVm.getDetails();
+ vmDetails = vmDetails.entrySet()
+ .stream()
+ .filter(map -> map.getValue() != null)
+ .collect(Collectors.toMap(map -> map.getKey(),
map -> map.getValue()));
+ details.putAll(vmDetails);
Review comment:
@shwstppr changes LGTM ,to allow template creation from volume.
Do you know any reason to keep some keys (eg. _kvm.vnc.address_) with value
null? Ideally, value in the details table shouldn't accept null.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]