Change the name of Substitution_mappings to SubstitutionMappings 23/18623/1
authorshangxdy <shang.xiaodong@zte.com.cn>
Sat, 13 Aug 2016 18:35:34 +0000 (02:35 +0800)
committershangxdy <shang.xiaodong@zte.com.cn>
Sat, 13 Aug 2016 18:35:34 +0000 (02:35 +0800)
Change the name  of Substitution_mappings to SubstitutionMappings
consistent to other classes.

JIRA:PARSER-85

Change-Id: I9b27783ccec3f515cfcd2eca9995f09426bbfadd
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
tosca2heat/tosca-parser/toscaparser/substitution_mappings.py
tosca2heat/tosca-parser/toscaparser/topology_template.py

index 7fdce24..83ff590 100644 (file)
@@ -16,22 +16,12 @@ from toscaparser.common.exception import ExceptionCollector
 from toscaparser.common.exception import InvalidNodeTypeError
 from toscaparser.common.exception import MissingRequiredFieldError
 from toscaparser.common.exception import UnknownFieldError
-# from toscaparser.common.exception import ValidationError
-# from toscaparser.utils.gettextutils import _
-# from toscaparser.utils import validateutils
-# from toscaparser.nodetemplate import NodeTemplate
-# from toscaparser.elements.nodetype import NodeType
-# from toscaparser.parameters import Input
-# from toscaparser.parameters import Output
-# from toscaparser.groups import Group
-# from toscaparser.policy import Policy
-
 
 log = logging.getLogger('tosca')
 
 
-class Substitution_mappings(object):
-    '''Substitution_mappings class declaration
+class SubstitutionMappings(object):
+    '''SubstitutionMappings class declaration
 
     Substitution_mappings exports the topology template as an
     implementation of a Node type.
@@ -111,7 +101,7 @@ class Substitution_mappings(object):
         for name in inputs_names:
             if name not in [input.name for input in self.inputs]:
                 ExceptionCollector.appendException(
-                    UnknownFieldError(what='Substitution_mappings',
+                    UnknownFieldError(what='SubstitutionMappings',
                                       field=name))
 
     def _validate_capabilities(self):
index 0407653..fe05979 100644 (file)
@@ -22,7 +22,7 @@ from toscaparser.parameters import Input
 from toscaparser.parameters import Output
 from toscaparser.policy import Policy
 from toscaparser.relationship_template import RelationshipTemplate
-from toscaparser.substitution_mappings import Substitution_mappings
+from toscaparser.substitution_mappings import SubstitutionMappings
 from toscaparser.tpl_relationship_graph import ToscaGraph
 from toscaparser.utils.gettextutils import _
 
@@ -111,12 +111,12 @@ class TopologyTemplate(object):
     def _substitution_mappings(self):
         tpl_substitution_mapping = self._tpl_substitution_mappings()
         if tpl_substitution_mapping:
-            return Substitution_mappings(tpl_substitution_mapping,
-                                         self.nodetemplates,
-                                         self.inputs,
-                                         self.outputs,
-                                         self.sub_mapped_node_template,
-                                         self.custom_defs)
+            return SubstitutionMappings(tpl_substitution_mapping,
+                                        self.nodetemplates,
+                                        self.inputs,
+                                        self.outputs,
+                                        self.sub_mapped_node_template,
+                                        self.custom_defs)
 
     def _policies(self):
         policies = []
@@ -297,4 +297,4 @@ class TopologyTemplate(object):
     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)
+            return SubstitutionMappings.get_node_type(submap_tpl)