summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2021-04-15 11:15:31 +0100
committerChristophe Closset <christophe.closset@intl.att.com>2021-04-19 15:49:19 +0000
commitcd12a2ac6ddc43493c4ba0685dfc75f11bf2aa6b (patch)
treece6d6978b3b63e0fee657ed1674c7e2d9064627f /catalog-be/src/main
parent82ee153edbf6ffca0d69bd450b48037ee0465191 (diff)
Fix VSP update backend process
Fix the VSP update procedure which was being rejected by a condition that checks if a VFC being created has the same name, type and vendor release. This was recently introduced to avoid duplicate VFC creation during the initialization process. This change adds a condition to confirm that no VSP CSAR is involved, before trying to check for the name, type and vendor release. Change-Id: Ie46195e810cd72f7412acc7cb01a764ef010f58d Issue-ID: SDC-3561 Signed-off-by: André Schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-be/src/main')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java
index 787bc3e2de..b1841e55d8 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java
@@ -176,7 +176,7 @@ public class ResourceImportManager {
if (latestByName.isLeft()) {
throw new ByActionStatusComponentException(ActionStatus.COMPONENT_NAME_ALREADY_EXIST, resource.getName());
}
- } else {
+ } else if (!isCsarPresent(csarInfo)) {
final Either<Resource, StorageOperationStatus> component = toscaOperationFacade
.getComponentByNameAndVendorRelease(resource.getComponentType(), resource.getName(), resource.getVendorRelease(),
JsonParseFlagEnum.ParseAll);
@@ -210,6 +210,10 @@ public class ResourceImportManager {
return responsePair;
}
+ private boolean isCsarPresent(final CsarInfo csarInfo) {
+ return csarInfo != null && StringUtils.isNotEmpty(csarInfo.getCsarUUID());
+ }
+
private String getLatestCertifiedResourceId(Resource resource) {
Map<String, String> allVersions = resource.getAllVersions();
Double latestCertifiedVersion = 0.0;