From 01ebd589c53eed5f0b488960af50048254749f1a Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Mon, 11 Feb 2019 15:06:33 -0500 Subject: Fix for asdc service. Removed exception statements and added assert statements Updated to make sure duplicate config resources aren't getting added to the service. Change-Id: Ic05421711622492e09bc83d8cc126300362ea119 Issue-ID: SO-1496 Signed-off-by: Benjamin, Max (mb388a) --- .../onap/so/asdc/installer/heat/ToscaResourceInstaller.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java index 2f4d5ea6a1..90b705c019 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java @@ -554,8 +554,14 @@ public class ToscaResourceInstaller { for (RequirementAssignment requirement : requirementsList) { if (requirement.getNodeTemplateName().equals(spNode.getName())) { ConfigurationResourceCustomization configurationResource = createConfiguration(configNode, toscaResourceStruct, serviceProxy); - - configurationResourceList.add(configurationResource); + + Optional matchingObject = configurationResourceList.stream() + .filter(configurationResourceCustomization -> configNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID).equals(configurationResource.getModelCustomizationUUID())) + .findFirst(); + if(!matchingObject.isPresent()){ + configurationResourceList.add(configurationResource); + } + break; } } -- cgit 1.2.3-korg