You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/03/15 16:21:18 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4794: server: filter null details during volume to template creation

DaanHoogland commented on a change in pull request #4794:
URL: https://github.com/apache/cloudstack/pull/4794#discussion_r594484504



##########
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:
       exactly, see my comment above.




----------------------------------------------------------------
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:
users@infra.apache.org