diff options
author | 2018-01-16 14:21:27 +0530 | |
---|---|---|
committer | 2018-01-17 06:40:20 +0000 | |
commit | 6c03bbdc00dd380b1232a543b72a5e909c3af46d (patch) | |
tree | 7d0395b3614a02592fa1e63a8dd1052f42ea8bb3 /openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp | |
parent | 5197c8b7b3cf7576f1198e4b59a7d6484e793107 (diff) |
Incorrect FG version in vf-license-model.xml
vf-license-model.xml file should show the latest version of FG, which is currently linked with LA in VSP
Change-Id: Iafd14e2c964df5c4e276f96589e9ac95b8d64740
Issue-ID: SDC-935
Signed-off-by: amitjai <amitjai@amdocs.com>
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp')
-rw-r--r-- | openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java | 17 |
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()); |