summaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/main/java
diff options
context:
space:
mode:
authorsarada prasad sahoo <sarada.prasad.sahoo@huawei.com>2019-09-03 15:27:13 +0530
committersarada prasad sahoo <sarada.prasad.sahoo@huawei.com>2019-09-04 18:53:13 +0530
commit073d731620daa5dd08e41fcabfe7f5a463485e22 (patch)
tree033b97906b8b3c4de69c5086c748f217b5a25064 /asdc-controller/src/main/java
parent687cdacb9fd74629e94ebc0914ba8c72bb5015a5 (diff)
fix public NS distribution issue
Fix Multiple VFModule under single service distribution Issue-ID: SO-2275 Change-Id: I7a4a7dbb68d23c0e44f9985b3fdc89816dbfd232 Signed-off-by: sarada prasad sahoo <sarada.prasad.sahoo@huawei.com>
Diffstat (limited to 'asdc-controller/src/main/java')
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java14
1 files changed, 11 insertions, 3 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 da989b0155..c3ee081c69 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
@@ -656,7 +656,10 @@ public class ToscaResourceInstaller {
NetworkResourceCustomization networkCustomization = createNetwork(vlEntity, toscaResourceStruct,
heatTemplate, tempNetworkLookUp.getAicVersionMax(),
tempNetworkLookUp.getAicVersionMin(), service);
- service.getNetworkCustomizations().add(networkCustomization);
+ // only insert unique entries
+ if (!service.getNetworkCustomizations().contains(networkCustomization)) {
+ service.getNetworkCustomizations().add(networkCustomization);
+ }
} else {
throw new ArtifactInstallerException("No HeatTemplate found for artifactUUID: "
+ tempNetworkLookUp.getHeatTemplateArtifactUuid());
@@ -2499,7 +2502,6 @@ public class ToscaResourceInstaller {
// setting resource input for vnf customization
vnfResourceCustomization.setResourceInput(
getResourceInput(toscaResourceStructure, vnfResourceCustomization.getModelCustomizationUUID()));
- service.getVnfCustomizations().add(vnfResourceCustomization);
}
return vnfResourceCustomization;
@@ -2815,10 +2817,16 @@ public class ToscaResourceInstaller {
Service existingService = services.get(0);
List<VnfResourceCustomization> existingVnfCustomizations = existingService.getVnfCustomizations();
if (existingService != null) {
- service.getVnfCustomizations().addAll(existingVnfCustomizations);
+ // it is duplicating entries, so added a check
+ for (VnfResourceCustomization existingVnfResourceCustomization : existingVnfCustomizations) {
+ if (!service.getVnfCustomizations().contains(existingVnfResourceCustomization)) {
+ service.getVnfCustomizations().add(existingVnfResourceCustomization);
+ }
+ }
}
}
service.getVnfCustomizations().add(vnfResourceCustomization);
+
}