From 732d7b37a76993255497c5790765156cc7f897a2 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Thu, 13 Sep 2018 17:20:41 +0800 Subject: Support property in substitution mapping substitution mapping in the new specification has new property, and the ONAP project will use it; So parser will support the feature. JIRA: PARSER-186 Change-Id: I5b47558afccab87f53e75ba34de2b26506efcd41 Signed-off-by: shangxdy --- tosca2heat/tosca-parser/toscaparser/substitution_mappings.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tosca2heat/tosca-parser/toscaparser/substitution_mappings.py b/tosca2heat/tosca-parser/toscaparser/substitution_mappings.py index dea5de7..4150c2d 100644 --- a/tosca2heat/tosca-parser/toscaparser/substitution_mappings.py +++ b/tosca2heat/tosca-parser/toscaparser/substitution_mappings.py @@ -21,25 +21,28 @@ from toscaparser.common.exception import MissingRequiredOutputError from toscaparser.common.exception import UnknownFieldError from toscaparser.common.exception import UnknownOutputError from toscaparser.elements.nodetype import NodeType +from toscaparser.entity_template import EntityTemplate from toscaparser.utils.gettextutils import _ log = logging.getLogger('tosca') -class SubstitutionMappings(object): +class SubstitutionMappings(EntityTemplate): '''SubstitutionMappings class declaration SubstitutionMappings exports the topology template as an implementation of a Node type. ''' - SECTIONS = (NODE_TYPE, REQUIREMENTS, CAPABILITIES) = \ - ('node_type', 'requirements', 'capabilities') + SECTIONS = (NODE_TYPE, PROPERTIES, REQUIREMENTS, CAPABILITIES) = \ + ('node_type', 'properties', 'requirements', 'capabilities') OPTIONAL_OUTPUTS = ['tosca_id', 'tosca_name', 'state'] def __init__(self, sub_mapping_def, nodetemplates, inputs, outputs, sub_mapped_node_template, custom_defs): + super(SubstitutionMappings, self).__init__("sub_map", sub_mapping_def, + 'node_type', custom_defs) self.nodetemplates = nodetemplates self.sub_mapping_def = sub_mapping_def self.inputs = inputs or [] -- cgit 1.2.3-korg