From 44540b6c2b16637659099c65e31309fc7573ba7d Mon Sep 17 00:00:00 2001 From: shangxdy Date: Fri, 9 Sep 2016 17:41:48 +0800 Subject: Add keys validation testcase in substitution_mapping class Add keys validation in class of substitution_mapping according to specification of http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/TOSCA-Simple-Profile-YAML-v1.0.html: 1) Substitution mapping only supports keys of node_type, capabilities and requirements; 2) The key of node_type is required, the others are optional. JIRA:PARSER-80 Change-Id: Icd3284349175429e5ba5e52814819a6790f0e831 Signed-off-by: shangxdy --- tosca2heat/tosca-parser/toscaparser/tosca_template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tosca2heat/tosca-parser/toscaparser/tosca_template.py') diff --git a/tosca2heat/tosca-parser/toscaparser/tosca_template.py b/tosca2heat/tosca-parser/toscaparser/tosca_template.py index 2e815fd..84d953c 100644 --- a/tosca2heat/tosca-parser/toscaparser/tosca_template.py +++ b/tosca2heat/tosca-parser/toscaparser/tosca_template.py @@ -233,7 +233,7 @@ class ToscaTemplate(object): path=fname, parsed_params=parsed_params, yaml_dict_tpl=tosca_tpl, sub_mapped_node_template=nodetemplate) - if nested_template.has_substitution_mappings(): + if nested_template._has_substitution_mappings(): # Record the nested templates in top level template self.nested_tosca_templates_with_topology.\ append(nested_template) @@ -329,7 +329,7 @@ class ToscaTemplate(object): return TopologyTemplate.get_sub_mapping_node_type( tosca_tpl.get(TOPOLOGY_TEMPLATE)) - def has_substitution_mappings(self): + def _has_substitution_mappings(self): """Return True if the template has valid substitution mappings.""" return self.topology_template is not None and \ self.topology_template.substitution_mappings is not None -- cgit 1.2.3-korg