aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src
diff options
context:
space:
mode:
authorojasdubey <ojas.dubey@amdocs.com>2018-09-14 16:55:00 +0530
committerOren Kleks <orenkle@amdocs.com>2018-09-17 10:33:17 +0000
commit599f6c050b48932479fa91e189ee42ad2111d95a (patch)
tree8575cd550260857e9acb7fbf83f329dedb0acf57 /catalog-be/src
parente4962d6d2defd6052dffd32bbef623e1fb5fb76e (diff)
Bugfix - interface_types missing from tosca
1.Fix for interface_types missing from the tosca model for a resource/service 2. Interface name should not contain spaces to make the behavior consistent with tosca node type component naming Change-Id: I8e135a87d659d3fb17d284247bcf222a8be7ccde Issue-ID: SDC-1760 Signed-off-by: ojasdubey <ojas.dubey@amdocs.com>
Diffstat (limited to 'catalog-be/src')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java2
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtil.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
index d62c2c64eb..41b29e3517 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
@@ -550,7 +550,7 @@ public class ToscaExportHandler {
Map<String, ToscaNodeType> nodeTypes) {
log.debug("start convert node type for {}", component.getUniqueId());
ToscaNodeType toscaNodeType = createNodeType(component);
-
+ toscaNode.setInterface_types(addInterfaceTypeElement(component));
Either<Map<String, DataTypeDefinition>, TitanOperationStatus> dataTypesEither = dataTypeCache.getAll();
if (dataTypesEither.isRight()) {
log.debug("Failed to fetch all data types :", dataTypesEither.right().value());
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtil.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtil.java
index 5370a7849e..70fd2575f0 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtil.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtil.java
@@ -64,6 +64,9 @@ public class InterfacesOperationsToscaUtil {
return null;
}
final Map<String, InterfaceDefinition> interfaces = component.getInterfaces();
+ if (MapUtils.isEmpty(interfaces)) {
+ return null;
+ }
Map<String, Object> toscaInterfaceTypes = new HashMap<>();
for (InterfaceDefinition interfaceDefinition : interfaces.values()) {
ToscaInterfaceNodeType toscaInterfaceType = new ToscaInterfaceNodeType();