diff options
author | andre.schmid <andre.schmid@est.tech> | 2021-09-17 15:48:43 +0100 |
---|---|---|
committer | andre.schmid <andre.schmid@est.tech> | 2021-09-17 16:19:57 +0100 |
commit | d6b83fce723703f4dea0bce3675ecbf6996aaf9a (patch) | |
tree | 4c8e463a3f24cefdd18e3bb28a8573f7fae4f15b /catalog-be/src/main/java | |
parent | b3fca719b446b6ad72d723e0043219b249ab5752 (diff) |
Fix Update VSP when no version id is provided
Issue-ID: SDC-3730
Change-Id: Ic5a5a6ecf3b6775e022be649145e44b0907cbecf
Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-be/src/main/java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java | 6 |
1 files changed, 5 insertions, 1 deletions
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<VendorSoftwareProduct> 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); |