diff options
author | Steve Smokowski <ss835w@att.com> | 2019-02-04 13:40:00 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-02-04 13:40:00 +0000 |
commit | 2b3983621d6650ae767b5062a098b8343e5e3441 (patch) | |
tree | e84e47037656af3cc90288e1f12d43471f879073 | |
parent | 62572d10fe5ea77726371c624b6bcbb33ff1707b (diff) | |
parent | 0d15f2695791b59637101db3c6e64b2aa847016e (diff) |
Merge "make sure the NetworkResourceUUID are correct."
-rw-r--r-- | asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java | 19 |
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 fe41aae4cd..ebc705ce30 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 @@ -1054,7 +1054,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); @@ -1066,7 +1080,8 @@ public class ToscaResourceInstaller { networkResource.addNetworkResourceCustomization(networkResourceCustomization); networkResourceCustomization.setNetworkResource(networkResource); - } + } + return networkResourceCustomization; } |