From d6b83fce723703f4dea0bce3675ecbf6996aaf9a Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Fri, 17 Sep 2021 15:48:43 +0100 Subject: Fix Update VSP when no version id is provided Issue-ID: SDC-3730 Change-Id: Ic5a5a6ecf3b6775e022be649145e44b0907cbecf Signed-off-by: andre.schmid --- .../org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'catalog-be/src/main/java') diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java index b8a5d67d4a..a85b5542a0 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java @@ -223,7 +223,11 @@ public class CsarBusinessLogic extends BaseBusinessLogic { private VendorSoftwareProduct getCsar(final Resource resource, final User user) { final Optional vendorSoftwareProductOpt; try { - vendorSoftwareProductOpt = csarOperation.findVsp(resource.getCsarUUID(), resource.getCsarVersionId(), user); + if (resource.getCsarVersionId() == null) { + vendorSoftwareProductOpt = csarOperation.findLatestVsp(resource.getCsarUUID(), user); + } else { + vendorSoftwareProductOpt = csarOperation.findVsp(resource.getCsarUUID(), resource.getCsarVersionId(), user); + } } catch (final Exception exception) { log.error(EcompLoggerErrorCode.BUSINESS_PROCESS_ERROR, CsarBusinessLogic.class.getName(), exception.getMessage()); auditGetCsarError(resource, user, resource.getCsarUUID(), StorageOperationStatus.GENERAL_ERROR); -- cgit 1.2.3-korg