From 98d48a4b34f07ac40fddd2254b78b9ea84f88fa3 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 15 Nov 2017 18:25:57 -0500 Subject: Modified create-vcpe to filter out "bad" VNFs Modified create-vcpe to delete the BRG and TXC items from the service VNF list contained within the service decomposition structure. Change-Id: I7624a93b422fa172a2079f70d66a2604ee2229b0 Issue-Id: SO-344 Signed-off-by: Jim Hahn --- .../vcpe/scripts/CreateVcpeResCustService.groovy | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy/org') diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy index 703ea8be6d..dd6d4514bc 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy @@ -343,6 +343,9 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { // VNFs List vnfList = serviceDecomposition.getServiceVnfs() + filterVnfs(vnfList) + serviceDecomposition.setServiceVnfs(vnfList) + execution.setVariable("vnfList", vnfList) execution.setVariable("vnfListString", vnfList.toString()) @@ -372,6 +375,24 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) } } + + private void filterVnfs(List vnfList) { + if(vnfList == null) { + return + } + + // remove BRG & TXC from VNF list + + Iterator it = vnfList.iterator() + while(it.hasNext()) { + VnfResource vr = it.next() + + String role = vr.getNfRole() + if(role == "BRG" || role == "TunnelXConn") { + it.remove() + } + } + } public void prepareCreateAllottedResourceTXC(Execution execution) { -- cgit