weizhouapache commented on code in PR #12499:
URL: https://github.com/apache/cloudstack/pull/12499#discussion_r2716593552


##########
server/src/main/java/org/apache/cloudstack/storage/template/VnfTemplateManagerImpl.java:
##########
@@ -213,6 +216,19 @@ public void 
validateVnfApplianceNics(VirtualMachineTemplate template, List<Long>
         }
     }
 
+    @Override
+    public void validateVnfApplianceNetworksMap(VirtualMachineTemplate 
template, Map<Integer, Long> vmNetworkMap) {
+        if (MapUtils.isEmpty(vmNetworkMap)) {
+            throw new InvalidParameterValueException("VNF networks map is 
empty");
+        }
+        List<VnfTemplateNicVO> vnfNics = 
vnfTemplateNicDao.listByTemplateId(template.getId());
+        for (VnfTemplateNicVO vnfNic : vnfNics) {
+            if (vnfNic.isRequired() && vmNetworkMap.size() <= 
vnfNic.getDeviceId()) {

Review Comment:
   @nvazquez 
   I have applied the changes, but then reverted it. as I found that in 
`vmNetworkMap`, the keys do not start with 0 (device IDs are 0,1,2...)



-- 
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]

Reply via email to