summaryrefslogtreecommitdiffstats
path: root/asdc-controller
diff options
context:
space:
mode:
Diffstat (limited to 'asdc-controller')
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java19
1 files changed, 17 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 7951e9be76..6c92224909 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
@@ -1055,7 +1055,21 @@ public class ToscaResourceInstaller {
ToscaResourceStructure toscaResourceStructure, HeatTemplate heatTemplate, String aicMax, String aicMin,Service service) {
NetworkResourceCustomization networkResourceCustomization=networkCustomizationRepo.findOneByModelCustomizationUUID(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
- if(networkResourceCustomization==null){
+
+ boolean networkUUIDsMatch = true;
+ // Check to make sure the NetworkResourceUUID on the Customization record matches the NetworkResourceUUID from the distribution.
+ // If not we'll update the Customization record with latest from the distribution
+ if(networkResourceCustomization != null){
+ String existingNetworkModelUUID = networkResourceCustomization.getNetworkResource().getModelUUID();
+ String latestNetworkModelUUID = networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID);
+
+ if(!existingNetworkModelUUID.equals(latestNetworkModelUUID)){
+ networkUUIDsMatch = false;
+ }
+
+ }
+
+ if(networkResourceCustomization==null || !networkUUIDsMatch){
networkResourceCustomization = createNetworkResourceCustomization(networkNodeTemplate,
toscaResourceStructure);
@@ -1067,7 +1081,8 @@ public class ToscaResourceInstaller {
networkResource.addNetworkResourceCustomization(networkResourceCustomization);
networkResourceCustomization.setNetworkResource(networkResource);
- }
+ }
+
return networkResourceCustomization;
}