diff options
author | shangxdy <shang.xiaodong@zte.com.cn> | 2016-07-31 02:10:03 +0800 |
---|---|---|
committer | shangxdy <shang.xiaodong@zte.com.cn> | 2016-08-03 16:33:11 +0800 |
commit | b74bf46baed7e586028255c8274ebf563d2ff446 (patch) | |
tree | fc899844369fb782ab4b33df89f3f47647419a8d /tosca2heat/tosca-parser/toscaparser/topology_template.py | |
parent | 476e9f0f430ce371cadc1f34e2601327732d0c05 (diff) |
Distinguish the mapping and mapped by name.
1. Use complete name like nested_topology_tpls here and other places
like get_nested_topology_tpls for better readability;
2. Use "sub_mapped_node_tpl" instead of submaped_node_tpl;
3. Use sub_mapped_ instead of submaped.
Upper changed in substitution_mappings.py, tosca_template.py,
tosca_template.py and others
JIRA:PARSER-73
Change-Id: I21b2d3a35773078d7437bbae9ff5d1522608c4d2
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/topology_template.py')
-rw-r--r-- | tosca2heat/tosca-parser/toscaparser/topology_template.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/topology_template.py b/tosca2heat/tosca-parser/toscaparser/topology_template.py index 70bc7d6..4039257 100644 --- a/tosca2heat/tosca-parser/toscaparser/topology_template.py +++ b/tosca2heat/tosca-parser/toscaparser/topology_template.py @@ -43,9 +43,9 @@ class TopologyTemplate(object): '''Load the template data.''' def __init__(self, template, custom_defs, rel_types=None, parsed_params=None, - submaped_node_template=None): + sub_mapped_node_template=None): self.tpl = template - self.submaped_node_template = submaped_node_template + self.sub_mapped_node_template = sub_mapped_node_template if self.tpl: self.custom_defs = custom_defs self.rel_types = rel_types @@ -110,12 +110,12 @@ class TopologyTemplate(object): def _substitution_mappings(self): tpl_substitution_mapping = self._tpl_substitution_mappings() - if tpl_substitution_mapping and self.submaped_node_template: + if tpl_substitution_mapping and self.sub_mapped_node_template: return Substitution_mappings(tpl_substitution_mapping, self.nodetemplates, self.inputs, self.outputs, - self.submaped_node_template, + self.sub_mapped_node_template, self.custom_defs) def _policies(self): @@ -294,7 +294,7 @@ class TopologyTemplate(object): output.attrs[output.VALUE] = func @classmethod - def get_submaped_node_type(cls, topo_tpl): - if topo_tpl and isinstance(topo_tpl, dict): - submap_tpl = topo_tpl.get(SUBSTITUION_MAPPINGS) + def get_sub_mapping_node_type(cls, topology_tpl): + if topology_tpl and isinstance(topology_tpl, dict): + submap_tpl = topology_tpl.get(SUBSTITUION_MAPPINGS) return Substitution_mappings.get_node_type(submap_tpl) |