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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Wei Zhou 2026-01-22 12:45:05 +01:00 committed by GitHub
parent fb012c8f64
commit 0bfc65aa00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -226,7 +226,7 @@ public class VnfTemplateManagerImpl extends ManagerBase implements VnfTemplateMa
}
List<VnfTemplateNicVO> vnfNics = vnfTemplateNicDao.listByTemplateId(template.getId());
for (VnfTemplateNicVO vnfNic : vnfNics) {
if (vnfNic.isRequired() && vmNetworkMap.size() <= vnfNic.getDeviceId()) {
if (vnfNic.isRequired() && !vmNetworkMap.containsKey(vnfNic.getDeviceId())) {
throw new InvalidParameterValueException("VNF nic is required but not found: " + vnfNic);
}
}