Support property in substitution mapping 57/62257/1 1.0.2
authorshangxdy <shang.xiaodong@zte.com.cn>
Thu, 13 Sep 2018 09:20:41 +0000 (17:20 +0800)
committershangxdy <shang.xiaodong@zte.com.cn>
Thu, 13 Sep 2018 13:25:48 +0000 (21:25 +0800)
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 <shang.xiaodong@zte.com.cn>
tosca2heat/tosca-parser/toscaparser/substitution_mappings.py

index dea5de7..4150c2d 100644 (file)
@@ -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 []