summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfranciscovila <javier.paradela.vila@est.tech>2023-10-20 17:26:29 +0100
committerFrancisco Javier Paradela Vila <javier.paradela.vila@est.tech>2023-10-20 18:27:55 +0000
commit07e9d2aae2e3fe8a786f0032e30288ec11bce387 (patch)
tree0087e71ba3c442d709dc7bef8a6bfd9803af5231
parent980530fa79f437332ec9b83f728c47b42d162ac2 (diff)
Certifying mechanism changing structure of csar
Issue-ID: SDC-4662 Signed-off-by: franciscovila <javier.paradela.vila@est.tech> Change-Id: I238fe7fd60c8813f67818606f5a69fc961820e88
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java7
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CommonCsarGenerator.java2
2 files changed, 7 insertions, 2 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java
index d50ae540a5..06b4a34062 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java
@@ -377,7 +377,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic {
return new ByResponseFormatComponentException(error);
});
} else {
- return toscaExportUtils.exportComponent(parent).left().map(toscaRepresentation -> {
+ return toscaExportUtils.exportComponent(parent, checkIfSkipImports(parent.getModel())).left().map(toscaRepresentation -> {
log.debug("Tosca yaml exported for component {} ", parent.getUniqueId());
return toscaRepresentation.getMainYaml();
}).right().map(toscaError -> {
@@ -387,6 +387,11 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic {
}
}
+ private boolean checkIfSkipImports(final String model) {
+ return null != model && !model.equalsIgnoreCase("ETSI SOL001 v2.5.1")
+ && !model.equalsIgnoreCase("AUTOMATION COMPOSITION");
+ }
+
private Either<ArtifactDefinition, Operation> doAction(String componentId, ComponentTypeEnum componentType, ArtifactOperationInfo operation,
String artifactId, ArtifactDefinition artifactInfo, String origMd5, String originData,
String interfaceName, String operationName, AuditingActionEnum auditingAction, User user,
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CommonCsarGenerator.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CommonCsarGenerator.java
index 677be6056d..a0e4203fe0 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CommonCsarGenerator.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CommonCsarGenerator.java
@@ -215,8 +215,8 @@ public class CommonCsarGenerator {
zip.putNextEntry(new ZipEntry(definitionsPath + fileName));
zip.write(mainYaml);
LifecycleStateEnum lifecycleState = component.getLifecycleState();
- addServiceMf(component, zip, lifecycleState, isInCertificationRequest, fileName, mainYaml, definitionsPath);
if (addDependencies) {
+ addServiceMf(component, zip, lifecycleState, isInCertificationRequest, fileName, mainYaml, definitionsPath);
//US798487 - Abstraction of complex types
if (hasToWriteComponentSubstitutionType(component)) {
LOGGER.debug("Component {} is complex - generating abstract type for it..", component.getName());