summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshangxdy <shang.xiaodong@zte.com.cn>2018-09-13 17:20:41 +0800
committershangxdy <shang.xiaodong@zte.com.cn>2018-09-13 21:25:48 +0800
commit732d7b37a76993255497c5790765156cc7f897a2 (patch)
treee20e66020d4814baa937f59b6d46b16f66c91156
parent26fc7a76a06c83eae2a75a262953b3d8d9bb00b3 (diff)
Support property in substitution mapping1.0.2
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>
-rw-r--r--tosca2heat/tosca-parser/toscaparser/substitution_mappings.py9
1 files 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 []