summaryrefslogtreecommitdiffstats
path: root/asdc-controller
diff options
context:
space:
mode:
authorSmokowski, Steve (ss835w) <ss835w@us.att.com>2018-12-05 14:43:36 -0500
committerSmokowski, Steve (ss835w) <ss835w@us.att.com>2018-12-05 14:43:37 -0500
commit2e4e2994babb0cff45ddf804910eca0ae00a3eb0 (patch)
tree722dfb91eb3d19a17e591393a8f561504ea165ee /asdc-controller
parent35726250e078b57ebe6ea4e53b4b8ccd56573e50 (diff)
Replace Hard Coded Function
- Replaced the VNFC hardcoded Function with the function value that is set on the node template. Change-Id: Id3b2e3a05c5dc9392509972fdf557ec1fc6c3beb Issue-ID: SO-1279 Signed-off-by: Smokowski, Steve (ss835w) <ss835w@us.att.com>
Diffstat (limited to 'asdc-controller')
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java16
1 files changed, 13 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 c8f7f05436..ac15fb974c 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
@@ -1152,7 +1152,7 @@ public class ToscaResourceInstaller {
}
protected VnfcInstanceGroupCustomization createVNFCInstanceGroup(NodeTemplate vnfcNodeTemplate, Group group,
- VnfResourceCustomization vnfResourceCustomization) {
+ VnfResourceCustomization vnfResourceCustomization, ToscaResourceStructure toscaResourceStructure) {
Metadata instanceMetadata = group.getMetadata();
// Populate InstanceGroup
@@ -1172,7 +1172,17 @@ public class ToscaResourceInstaller {
vfcInstanceGroupCustom.setModelCustomizationUUID(vnfResourceCustomization.getModelCustomizationUUID());
vfcInstanceGroupCustom.setModelUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
vfcInstanceGroupCustom.setDescription(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
- vfcInstanceGroupCustom.setFunction("FUNCTION");
+
+ String getInputName = null;
+ String groupProperty = toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group, "vfc_instance_group_function");
+ if (groupProperty != null) {
+ int getInputIndex = groupProperty.indexOf("{get_input=");
+ if (getInputIndex > -1) {
+ getInputName = groupProperty.substring(getInputIndex+11, groupProperty.length()-1);
+ }
+ }
+ vfcInstanceGroupCustom.setFunction(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vnfcNodeTemplate, getInputName));
+
vfcInstanceGroupCustom.setInstanceGroup(vfcInstanceGroup);
vfcInstanceGroupCustom.setVnfResourceCust(vnfResourceCustomization);
@@ -1595,7 +1605,7 @@ public class ToscaResourceInstaller {
for (Group group : groupList) {
- VnfcInstanceGroupCustomization vnfcInstanceGroupCustomization = createVNFCInstanceGroup(vfNodeTemplate, group, vnfResourceCustomization);
+ VnfcInstanceGroupCustomization vnfcInstanceGroupCustomization = createVNFCInstanceGroup(vfNodeTemplate, group, vnfResourceCustomization, toscaResourceStructure);
vnfcInstanceGroupCustomizationRepo.saveAndFlush(vnfcInstanceGroupCustomization);
}