diff options
author | 2017-10-24 18:45:00 +0300 | |
---|---|---|
committer | 2017-10-24 15:46:06 +0000 | |
commit | 729eb6708fd48294c32da856c46515ff14a831d0 (patch) | |
tree | 0708a7fed61956e2b4801ee5837858527a4de92e /catalog-be/src/main/java/org/openecomp | |
parent | e211e63edef1b88d8f7da53f3d1f0d5fb26d1555 (diff) |
align MME
- [BUG323816] Don't add a property to a newly generated csar if the
value is not set and the default value is not provided
Change-Id: I76b312ef8140ca6207aa7604026c1b0a89bfbe02
Issue-ID:SDC-500
Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java index 646a7ecc8b..68adbd5ae3 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java @@ -74,7 +74,9 @@ public class PropertyConvertor { props.stream().filter(p -> p.getOwnerId() == null || p.getOwnerId().equals(component.getUniqueId())).forEach(property -> { ToscaProperty prop = convertProperty(dataTypes, property, false); - properties.put(property.getName(), prop); + if (prop != null) { + properties.put(property.getName(), prop); + } }); if (!properties.isEmpty()) { toscaNodeType.setProperties(properties); @@ -98,13 +100,17 @@ public class PropertyConvertor { } log.trace("try to convert property {} from type {} with default value [{}]", property.getName(), property.getType(), property.getDefaultValue()); prop.setDefaultp(convertToToscaObject(property.getType(), property.getDefaultValue(), innerType, dataTypes)); + + if (prop.getDefaultp() == null) { + return null; + } prop.setType(property.getType()); - prop.setDescription(property.getDescription()); - if (isCapabiltyProperty) { - prop.setStatus(property.getStatus()); - prop.setRequired(property.isRequired()); - } - return prop; + prop.setDescription(property.getDescription()); + if (isCapabiltyProperty) { + prop.setStatus(property.getStatus()); + prop.setRequired(property.isRequired()); + } + return prop; } public Object convertToToscaObject(String propertyType, String value, String innerType, Map<String, DataTypeDefinition> dataTypes) { |