aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2019-02-11 15:06:33 -0500
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-02-11 15:06:50 -0500
commit01ebd589c53eed5f0b488960af50048254749f1a (patch)
tree3410f7e74c2e55b7a6b681fdbaec5f026f3981ad
parentb80f29cbbeb5ec218b0278deef872f7b5350e292 (diff)
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) <mb388a@us.att.com>
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java10
1 files 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<ConfigurationResourceCustomization> matchingObject = configurationResourceList.stream()
+ .filter(configurationResourceCustomization -> configNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID).equals(configurationResource.getModelCustomizationUUID()))
+ .findFirst();
+ if(!matchingObject.isPresent()){
+ configurationResourceList.add(configurationResource);
+ }
+
break;
}
}