Skip to content

Commit 0bfc65a

Browse files
Update server/src/main/java/org/apache/cloudstack/storage/template/VnfTemplateManagerImpl.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent fb012c8 commit 0bfc65a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/java/org/apache/cloudstack/storage/template/VnfTemplateManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ private void validateVnfApplianceNetworksMap(VirtualMachineTemplate template, Ma
226226
}
227227
List<VnfTemplateNicVO> vnfNics = vnfTemplateNicDao.listByTemplateId(template.getId());
228228
for (VnfTemplateNicVO vnfNic : vnfNics) {
229-
if (vnfNic.isRequired() && vmNetworkMap.size() <= vnfNic.getDeviceId()) {
229+
if (vnfNic.isRequired() && !vmNetworkMap.containsKey(vnfNic.getDeviceId())) {
230230
throw new InvalidParameterValueException("VNF nic is required but not found: " + vnfNic);
231231
}
232232
}

0 commit comments

Comments
 (0)