From cd12a2ac6ddc43493c4ba0685dfc75f11bf2aa6b Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Thu, 15 Apr 2021 11:15:31 +0100 Subject: [PATCH] Fix VSP update backend process MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- .../org/openecomp/sdc/be/components/impl/ResourceImportManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 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 allVersions = resource.getAllVersions(); Double latestCertifiedVersion = 0.0; -- 2.16.6