diff options
author | JvD_Ericsson <jeff.van.dam@est.tech> | 2022-11-21 09:55:26 +0000 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2022-12-02 09:44:21 +0000 |
commit | be7ba43b95f13bb390cdd77a15c35072781e5546 (patch) | |
tree | ae20f499478a455e9355ff0bc6bd47010184b5ea /catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src | |
parent | 1336da0b9a713b9d6cf1e3f6ea709c50be43d4ab (diff) |
Fix numeric constraint values generated as strings
When importing a vfc the property constraints are now
checked to see if they are the same type as the property
If not it will attempt to convert to that type
Issue-ID: SDC-4274
Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
Change-Id: I32c1d930166d10142ad9ca6914550c7946e9128c
Diffstat (limited to 'catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src')
-rw-r--r-- | catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/main/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/NsDescriptorGeneratorImpl.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/main/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/NsDescriptorGeneratorImpl.java b/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/main/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/NsDescriptorGeneratorImpl.java index 9572c44a6b..eb601d836d 100644 --- a/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/main/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/NsDescriptorGeneratorImpl.java +++ b/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/main/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/NsDescriptorGeneratorImpl.java @@ -151,12 +151,12 @@ public class NsDescriptorGeneratorImpl implements NsDescriptorGenerator { return returnValueOnError; } final ToscaPropertyConstraintValidValues validValuesConstraint = (ToscaPropertyConstraintValidValues) toscaPropertyConstraint; - final List<String> validValues = validValuesConstraint.getValidValues(); + final List<Object> validValues = validValuesConstraint.getValidValues(); if (CollectionUtils.isEmpty(validValues)) { LOGGER.error(errorMsg); return returnValueOnError; } - return validValues.get(0); + return String.valueOf(validValues.get(0)); } private ToscaTemplate createNetworkServiceDescriptor(final Component component, final List<VnfDescriptor> vnfDescriptorList) throws NsdException { |