diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2019-09-05 04:11:11 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-09-05 04:11:11 +0000 |
commit | edaf71b6d2988253d2f0b43273268c14c14d788d (patch) | |
tree | 70149aaebcb74d8942dd96768748a495958c7ea2 /asdc-controller/src/main/java | |
parent | 4c81727a226d80c4ac07df61302dca3540f507d0 (diff) | |
parent | 073d731620daa5dd08e41fcabfe7f5a463485e22 (diff) |
Merge "fix public NS distribution issue"
Diffstat (limited to 'asdc-controller/src/main/java')
-rw-r--r-- | asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java | 14 |
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); + } |