aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be
diff options
context:
space:
mode:
authorzhaoxiangjun666 <xjzhaop@isoftstone.com>2020-10-26 09:52:18 +0800
committerS�bastien Determe <sebastien.determe@intl.att.com>2020-10-26 09:26:25 +0000
commit14d212dc5046d597b8b56ae04fcb545b633b79f6 (patch)
treefc142107e95e0d4f69807e4f4d7d12646e48a5cb /catalog-be
parent65fec643907871f80aba674eb1acb30bdad6c89e (diff)
To solve the problem that the CSAR file cannot be imported when it is imported on the page, a 500 error is reported
Issue-ID: SDC-3332 Change-Id: Ic62a7a3d5681c1a7d18feddd9be8f216a32cd31f Signed-off-by: zhaoxiangjun666 <xjzhaop@isoftstone.com>
Diffstat (limited to 'catalog-be')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/YamlTemplateParsingHandler.java16
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportManager.java8
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaUtils.java6
3 files changed, 21 insertions, 9 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/YamlTemplateParsingHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/YamlTemplateParsingHandler.java
index 9636885190..58f46bcfa7 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/YamlTemplateParsingHandler.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/YamlTemplateParsingHandler.java
@@ -320,7 +320,7 @@ public class YamlTemplateParsingHandler {
.left()
.on(err -> logGroupsNotFound(fileName));
- if (MapUtils.isNotEmpty(foundGroups)) {
+ if (MapUtils.isNotEmpty(foundGroups) && matcheKey(foundGroups)) {
Map<String, GroupDefinition> groups = foundGroups
.entrySet()
.stream()
@@ -336,6 +336,20 @@ public class YamlTemplateParsingHandler {
return new HashMap<>();
}
+ private boolean matcheKey(Map<String, Object> foundGroups){
+ if (foundGroups!=null && !foundGroups.isEmpty()) {
+ for (Map.Entry<String, Object> stringObjectEntry : foundGroups.entrySet()) {
+ String key = stringObjectEntry.getKey();
+ if (key.contains("group")) {
+ if (foundGroups.get(key) instanceof Map) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
private Map<String, Object> logGroupsNotFound(String fileName) {
log.debug("#logGroupsNotFound - Groups were not found in the yaml template {}.", fileName);
return new HashMap<>();
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportManager.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportManager.java
index 8e7c1e852c..fa079d2f65 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportManager.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportManager.java
@@ -92,14 +92,6 @@ public class ServiceImportManager {
}
}
- public void populateRealServiceMetadata(UploadServiceInfo serviceMetaData, Service service) {
- if (service != null && serviceMetaData != null) {
- service.setTags(serviceMetaData.getTags());
- service.setContactId(serviceMetaData.getContactId());
- service.setName(serviceMetaData.getName());
- }
- }
-
public synchronized void init(ServletContext servletContext) {
if (this.servletContext == null) {
this.servletContext = servletContext;
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaUtils.java
index 5b03b6378e..38e60617c4 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaUtils.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaUtils.java
@@ -41,6 +41,12 @@ public class ToscaUtils {
if (ResourceTypeEnum.CVFC == resourceType ) {
return false;
}
+ if (component.getComponentMetadataDefinition()!=null && component.getComponentMetadataDefinition().getMetadataDataDefinition()!=null
+ && component.getComponentMetadataDefinition().getMetadataDataDefinition().getDescription()!=null){
+ if(component.getComponentMetadataDefinition().getMetadataDataDefinition().getDescription().equalsIgnoreCase("Nested VF in service")){
+ return false;
+ }
+ }
}
return true;
}