diff options
author | Rob Daugherty <rd472p@att.com> | 2018-12-06 13:31:49 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-12-06 13:31:49 +0000 |
commit | 4e1e9dd0cc1e228f8aa2b7227b1d70802b3cc08f (patch) | |
tree | 80afecd444ee19c2c1f8c8ea921ad8c538ef496c | |
parent | 0206b168197aa32c350001417e3c2e50e3201ac1 (diff) | |
parent | 2e4e2994babb0cff45ddf804910eca0ae00a3eb0 (diff) |
Merge "Replace Hard Coded Function"
-rw-r--r-- | asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java | 16 |
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); } |