aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2019-04-21 17:38:05 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-21 17:38:05 +0000
commitefa8de7e27bf355586e51a18008d8c6727d1e743 (patch)
tree6179f7f3ad521777978b8af255876e5da95e8a6a
parent08e14dc13657fa700a5f89b8cab3f7199a071c15 (diff)
parent7f8b940085bd6b42cc9dd08d5c71091425542586 (diff)
Merge "Add existing vnf customization for service"
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java16
1 files changed, 15 insertions, 1 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 50a555882d..aba70f33e3 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
@@ -984,7 +984,8 @@ public class ToscaResourceInstaller {
}
- service.getVnfCustomizations().add(vnfResource);
+ // add this vnfResource with existing vnfResource for this service
+ addVnfCustomization(service, vnfResource);
} else {
logger.debug("Notification VF ResourceCustomizationUUID: "
+ vfNotificationResource.getResourceCustomizationUUID() + " doesn't match "
@@ -2440,6 +2441,19 @@ public class ToscaResourceInstaller {
return inputName;
}
+ // this method add provided vnfCustomization to service with
+ // existing customization available in db.
+ private void addVnfCustomization(Service service, VnfResourceCustomization vnfResourceCustomization) {
+ List<Service> services = serviceRepo.findByModelUUID(service.getModelUUID());
+ if (services.size() > 0) {
+ // service exist in db
+ Service existingService = services.get(0);
+ List<VnfResourceCustomization> vnfCustomizations = existingService.getVnfCustomizations();
+ vnfCustomizations.forEach(e -> service.getVnfCustomizations().add(e));
+ }
+ service.getVnfCustomizations().add(vnfResourceCustomization);
+ }
+
protected static Timestamp getCurrentTimeStamp() {