From 1105a525206d3c8e36cfdd77d6b033e821617e21 Mon Sep 17 00:00:00 2001 From: stasys10 Date: Fri, 11 Feb 2022 10:26:10 +0000 Subject: Fix NSD plugin get version from model name Issue-ID: SDC-3881 Signed-off-by: stasys10 Change-Id: Ib90020e46079866b5846b50aa3f183ae5bf74f6c --- .../plugins/etsi/nfv/nsd/generator/EtsiNfvNsCsarEntryGenerator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/main/java') diff --git a/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/main/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/EtsiNfvNsCsarEntryGenerator.java b/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/main/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/EtsiNfvNsCsarEntryGenerator.java index 4640492441..f5d7828e2d 100644 --- a/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/main/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/EtsiNfvNsCsarEntryGenerator.java +++ b/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/main/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/EtsiNfvNsCsarEntryGenerator.java @@ -90,7 +90,11 @@ public class EtsiNfvNsCsarEntryGenerator implements CsarEntryGenerator { } private EtsiVersion getComponentEtsiVersion(Component component) { - final String etsiVersion = component.getCategorySpecificMetadata().get(ETSI_VERSION_METADATA); + String etsiVersion = component.getCategorySpecificMetadata().get(ETSI_VERSION_METADATA); + final String modelName = component.getModel(); + if (etsiVersion == null && modelName.matches(".*\\d+\\.\\d+\\.\\d+.*" )){ + etsiVersion = modelName.replaceAll(".*?(\\d+\\.\\d+\\.\\d+).*", "$1"); + } return EtsiVersion.convertOrNull(etsiVersion); } -- cgit 1.2.3-korg