summaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main')
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java
index a022fb697e..d36f1bc8ce 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java
@@ -100,6 +100,8 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.ComponentQu
import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext;
import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput;
import org.openecomp.sdc.vendorsoftwareproduct.utils.ComponentDependencyTracker;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
import org.openecomp.sdc.versioning.VersioningUtil;
import org.openecomp.sdc.versioning.dao.types.Version;
@@ -628,7 +630,9 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa
ToscaServiceModel toscaServiceModel = enrichedServiceModelDao.getServiceModel(vspId, version);
VspDetails vspDetails = vspInfoDao.get(new VspDetails(vspId, version));
Version vlmVersion = vspDetails.getVlmVersion();
-
+ if (vlmVersion != null) {
+ populateVersionsForVlm(vspDetails.getVendorId(), vlmVersion);
+ }
PackageInfo packageInfo = createPackageInfo(vspDetails);
ToscaFileOutputServiceCsarImpl toscaServiceTemplateServiceCsar =
@@ -646,6 +650,17 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa
return packageInfo;
}
+ protected void populateVersionsForVlm(String vlmId, Version vlmVersion) {
+ VersioningManager versioningManager = VersioningManagerFactory.getInstance().createInterface();
+ versioningManager.list(vlmId).stream()
+ .filter(version -> version.getId().equalsIgnoreCase(vlmVersion.getId()))
+ .findAny()
+ .ifPresent(version -> {
+ vlmVersion.setMinor(vlmVersion.getMinor());
+ vlmVersion.setMajor(vlmVersion.getMajor());
+ });
+ }
+
private PackageInfo createPackageInfo(VspDetails vspDetails) {
PackageInfo packageInfo = new PackageInfo(vspDetails.getId(), vspDetails.getVersion());
packageInfo.setVspName(vspDetails.getName());