aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2021-08-31 16:58:08 +0100
committerMichael Morris <michael.morris@est.tech>2021-09-01 10:53:50 +0000
commit1d20d6ef6f0c85e487d9cb7e6ceed0e0f3fd8677 (patch)
tree8ef641c8861f349557be4ddc15bcdb147ca3e2e0 /openecomp-be/lib/openecomp-sdc-vendor-software-product-lib
parent38c6faa738abe6e0acdd24df2364d725d36fca40 (diff)
Fix setting vendor release for VSP with model
When a model is selected, the vendor release should not be set based on the compatible_specification_version of the manifest metadata. Change-Id: I7a01941c47a8a7f1d3a7f69bfa0830db3d11fb0c Issue-ID: SDC-3708 Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib')
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/etsi/ETSIServiceImpl.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/etsi/ETSIServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/etsi/ETSIServiceImpl.java
index 2e06202471..c5e7fcd03d 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/etsi/ETSIServiceImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/etsi/ETSIServiceImpl.java
@@ -36,6 +36,7 @@ import java.io.InputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -189,8 +190,8 @@ public class ETSIServiceImpl implements ETSIService {
try {
Map<String, String> metadata = getManifest(handler).getMetadata();
if (metadata.containsKey(COMPATIBLE_SPECIFICATION_VERSIONS.getToken())) {
- return Arrays.asList(metadata.get(COMPATIBLE_SPECIFICATION_VERSIONS.getToken()).split(",")).stream().map(Semver::new)
- .max((v1, v2) -> v1.compareTo(v2)).orElse(new Semver(ETSI_VERSION_2_6_1));
+ return Arrays.stream(metadata.get(COMPATIBLE_SPECIFICATION_VERSIONS.getToken()).split(",")).map(String::trim).map(Semver::new)
+ .max(Comparator.naturalOrder()).orElse(new Semver(ETSI_VERSION_2_6_1));
}
} catch (Exception ex) {
LOGGER.error("An error occurred while getting highest compatible version from manifest file", ex);