Fix: selection of VIMs to deploy if not defined in VNFD
@@ -69,14 +69,17 @@ public class VnfPlacementManagement
for (VimInstance vimInstance : vimInstances) {
if (vimTypes.contains(vimInstance.getType())) {
vimInstancesChosen.add(vimInstance.getName());
+ return vimInstancesChosen;
}
}
} else {
for (VimInstance vimInstance : vimInstances) {
vimInstancesChosen.add(vimInstance.getName());
+ return vimInstancesChosen;
}
}
- if (vimInstancesChosen.isEmpty() && vimTypes != null && !vimTypes.isEmpty()) {
+ if (vimInstancesChosen.isEmpty()) {
+ if (vimTypes != null && !vimTypes.isEmpty()) {
throw new NotFoundException(
"Not found any VIM which supports the following types: " + vimTypes);
} else {
@@ -85,5 +88,8 @@ public class VnfPlacementManagement
+ virtualNetworkFunctionDescriptor.getId()
+ " can be deployed");
}
+ } else {
+ return vimInstancesChosen;
+ }
}
}
