- Make association from the cvnfc to the fabric
- Make association from the cvnfc to the fabric config.
Issue-ID: SO-2262
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: I8d9c1e5b738ec36fb3c6d9bae4acfef155b0e058
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 08aee1a..8894df0 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
@@ -2154,6 +2154,7 @@
cvnfcCustomization.setNfcNamingCode(getLeafPropertyValue(cvfcEntity, "nfc_naming_code"));
cvnfcCustomization.setVfModuleCustomization(vfModuleCustomization);
+
// *****************************************************************************************************************************************
// * Extract Fabric Configuration
// *****************************************************************************************************************************************
@@ -2162,32 +2163,40 @@
getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.CONFIGURATION),
TopologyTemplateQuery.newBuilder(SdcTypes.VF), false);
-
for (IEntityDetails fabricEntity : fabricEntityList) {
- ConfigurationResource fabricConfig = null;
+ Map<String, RequirementAssignment> requirements = fabricEntity.getRequirements();
- ConfigurationResource existingConfig =
- findExistingConfiguration(existingCvnfcConfigurationCustom,
+ for (RequirementAssignment requirement : requirements.values()) {
+
+ if (requirement.getNodeTemplateName().equals(cvfcEntity.getName())) {
+
+ ConfigurationResource fabricConfig = null;
+
+ ConfigurationResource existingConfig = findExistingConfiguration(
+ existingCvnfcConfigurationCustom,
fabricEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
- if (existingConfig == null) {
+ if (existingConfig == null) {
- fabricConfig = createFabricConfiguration(fabricEntity, toscaResourceStructure);
+ fabricConfig = createFabricConfiguration(fabricEntity, toscaResourceStructure);
- } else {
- fabricConfig = existingConfig;
+ } else {
+ fabricConfig = existingConfig;
+ }
+
+ CvnfcConfigurationCustomization cvnfcConfigurationCustomization =
+ createCvnfcConfigurationCustomization(fabricEntity, toscaResourceStructure,
+ vnfResource, vfModuleCustomization, cvnfcCustomization,
+ fabricConfig, vfModuleMemberName);
+
+ cvnfcConfigurationCustomizations.add(cvnfcConfigurationCustomization);
+
+ existingCvnfcConfigurationCustom.add(cvnfcConfigurationCustomization);
+
+ }
}
- CvnfcConfigurationCustomization cvnfcConfigurationCustomization =
- createCvnfcConfigurationCustomization(fabricEntity, toscaResourceStructure,
- vnfResource, vfModuleCustomization, cvnfcCustomization, fabricConfig,
- vfModuleMemberName);
-
- cvnfcConfigurationCustomizations.add(cvnfcConfigurationCustomization);
-
- existingCvnfcConfigurationCustom.add(cvnfcConfigurationCustomization);
-
}
cvnfcCustomization.setCvnfcConfigurationCustomization(cvnfcConfigurationCustomizations);
cvnfcCustomizations.add(cvnfcCustomization);