diff options
author | 2018-06-05 14:35:25 +0530 | |
---|---|---|
committer | 2018-06-06 05:56:53 +0000 | |
commit | 16ecda5c6ebb673636e7c74e5501f9f2c8ae00b0 (patch) | |
tree | 1e30dc0cfb6f46d8257649463c628f46bc42adfe /openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp | |
parent | 1add92e5da0367c8fb2f19378ca34f097b870167 (diff) |
VFCInstanceGroup is not displayed on VF creation
Fixed issue for displaying VFCInstanceGroup
for VLAN tagging when naming convention is
correct
Change-Id: I5ea5c042458603389b1fb2aa6e6f985a7114049b
Issue-ID: SDC-1398
Signed-off-by: ojasdubey <ojas.dubey@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtil.java | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtil.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtil.java index 6b2770ceaf..64c2168241 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtil.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtil.java @@ -194,16 +194,38 @@ public class ConsolidationDataUtil { PortTemplateConsolidationData portTemplateConsolidationData = filePortConsolidationData.getPortTemplateConsolidationData(parentPortNodeTemplateId); if (portTemplateConsolidationData == null) { - portTemplateConsolidationData = new PortTemplateConsolidationData(); - portTemplateConsolidationData.setNodeTemplateId(parentPortNodeTemplateId); + Optional<String> portResourceId = getSubInterfaceParentPortResourceId(parentPortNodeTemplateId, + subInterfaceTo); + if (portResourceId.isPresent()) { + portTemplateConsolidationData = getInitPortTemplateConsolidationData(parentPortNodeTemplateId, + portResourceId.get(), HeatToToscaUtil.getResourceType(portResourceId.get(), subInterfaceTo + .getHeatOrchestrationTemplate(), subInterfaceTo.getHeatFileName())); + } else { + portTemplateConsolidationData = new PortTemplateConsolidationData(); + portTemplateConsolidationData.setNodeTemplateId(parentPortNodeTemplateId); + } filePortConsolidationData.setPortTemplateConsolidationData(parentPortNodeTemplateId, portTemplateConsolidationData); } - return portTemplateConsolidationData.addSubInterfaceTemplateConsolidationData( subInterfaceTo.getResource(), subInterfaceNodeTemplateId, parentPortNodeTemplateId); } + private static Optional<String> getSubInterfaceParentPortResourceId(String parentPortNodeTemplateId, + TranslateTo subInterfaceTo) { + Map<String, String> resourceIdTranslatedResourceIdMap = + subInterfaceTo.getContext().getTranslatedIds().get(subInterfaceTo.getHeatFileName()); + if (MapUtils.isEmpty(resourceIdTranslatedResourceIdMap)) { + return Optional.empty(); + } + for (Map.Entry<String, String> entry : resourceIdTranslatedResourceIdMap.entrySet()) { + if (entry.getValue().equals(parentPortNodeTemplateId)) { + return Optional.of(entry.getKey()); + } + } + return Optional.empty(); + } + /** * Gets nested template consolidation data. * |