From 9c94d11d63d9016af74dcf3a2fd72d50955eace2 Mon Sep 17 00:00:00 2001 From: talio Date: Thu, 14 Sep 2017 10:54:21 +0300 Subject: Removing service templates without node templates Bugfix for cases where we have substitution service templates without node templates Issue - ID : SDC-330 Change-Id: Ia9f33ce90fe0dbcc8ca2596ca63da704a48c7e67 Signed-off-by: talio --- .../java/org/openecomp/sdc/tosca/services/DataModelUtil.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/main/java/org') diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java index d908b2cf74..df2459368e 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java @@ -698,7 +698,7 @@ public class DataModelUtil { * @return the metadata */ public static Map createMetadata(String templateName, String templateVersion, - String templateAuthor) { + String templateAuthor) { mdcDataDebugMessage.debugEntryMessage(null, null); @@ -1318,7 +1318,7 @@ public class DataModelUtil { * @return the relationship template */ public static Map getRelationshipTemplates(ServiceTemplate - serviceTemplate) { + serviceTemplate) { if (serviceTemplate == null || serviceTemplate.getTopology_template() == null || serviceTemplate.getTopology_template().getRelationship_templates() == null) { @@ -1575,4 +1575,9 @@ public class DataModelUtil { mdcDataDebugMessage.debugExitMessage(null, null); } + + public static boolean isNodeTemplateSectionMissingFromServiceTemplate(ServiceTemplate serviceTemplate){ + return Objects.isNull(serviceTemplate.getTopology_template() ) + || MapUtils.isEmpty(serviceTemplate.getTopology_template().getNode_templates()); + } } -- cgit 1.2.3-korg