From a30778c360c0bcb8051e395e0ac4e9a3225c903a Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 21 Aug 2019 21:58:54 -0700 Subject: fix a nested node type issue the newly added node type is considered as nested when substitution_mapping is enabled in TOSCA yaml file Change-Id: Ibdee29d7a553c7b1ce085cbe971ceace6c4488f5 Issue-ID: SDC-2282 Signed-off-by: Liang Ding --- .../src/main/java/org/openecomp/sdc/be/components/csar/CsarInfo.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'catalog-be/src/main') diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarInfo.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarInfo.java index 72efb1176f..1d49394b17 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarInfo.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarInfo.java @@ -167,6 +167,7 @@ public class CsarInfo { private ResultStatusEnum handleSubstitutionMappings(Map nodeTypesInfo, Map.Entry entry, Map mappedToscaTemplate, Map substitutionMappings) { if (substitutionMappings.containsKey(TypeUtils.ToscaTagNamesEnum.NODE_TYPE.getElementName())) { NodeTypeInfo nodeTypeInfo = new NodeTypeInfo(); + nodeTypeInfo.setSubstitutionMapping(true); nodeTypeInfo.setType( (String) substitutionMappings.get(TypeUtils.ToscaTagNamesEnum.NODE_TYPE.getElementName())); nodeTypeInfo.setTemplateFileName(entry.getKey()); @@ -228,7 +229,9 @@ public class CsarInfo { String type = (String) nodeTemplate.get(TypeUtils.ToscaTagNamesEnum.TYPE.getElementName()); if (nodeTypesInfo.containsKey(type)) { NodeTypeInfo nodeTypeInfo = nodeTypesInfo.get(type); - nodeTypeInfo.setNested(true); + if (nodeTypeInfo.isSubstitutionMapping() && type.contains(Constants.USER_DEFINED_RESOURCE_NAMESPACE_PREFIX)) { + nodeTypeInfo.setNested(true); + } } } } -- cgit 1.2.3-korg