summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarInfo.java5
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/NodeTypeInfo.java7
2 files changed, 11 insertions, 1 deletions
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<String, NodeTypeInfo> nodeTypesInfo, Map.Entry<String, byte[]> entry, Map<String, Object> mappedToscaTemplate, Map<String, Object> 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);
+ }
}
}
}
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/NodeTypeInfo.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/NodeTypeInfo.java
index 5026fff129..817060e309 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/NodeTypeInfo.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/NodeTypeInfo.java
@@ -28,6 +28,7 @@ public class NodeTypeInfo {
String templateFileName;
List<String> derivedFrom;
boolean isNested;
+ boolean isSubstitutionMapping;
Map<String, Object> mappedToscaTemplate;
public NodeTypeInfo getUnmarkedCopy(){
@@ -64,6 +65,12 @@ public class NodeTypeInfo {
public void setNested(boolean isNested) {
this.isNested = isNested;
}
+ public boolean isSubstitutionMapping() {
+ return isSubstitutionMapping;
+ }
+ public void setSubstitutionMapping(boolean isSubstitutionMapping) {
+ this.isSubstitutionMapping = isSubstitutionMapping;
+ }
public Map<String, Object> getMappedToscaTemplate() {
return mappedToscaTemplate;