The definition about the sequence of capabilities and requirements in 43/18643/1
authorshangxdy <shang.xiaodong@zte.com.cn>
Mon, 15 Aug 2016 01:54:52 +0000 (09:54 +0800)
committershangxdy <shang.xiaodong@zte.com.cn>
Mon, 15 Aug 2016 01:54:52 +0000 (09:54 +0800)
SubstitutionMappings is error

The definition in SubstitutionMappings about SECTION is below:
  SECTIONS = (NODE_TYPE, CAPABILITIES, REQUIREMENTS) = \
               ('node_type', 'requirements', 'capabilities')
The order of CAPABILITIES and REQUIREMENTS is reserved.

JIRA:PARSER-86

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

index f644808..fe47ae4 100644 (file)
@@ -31,7 +31,7 @@ class SubstitutionMappings(object):
     implementation of a Node type.
     '''
 
-    SECTIONS = (NODE_TYPE, CAPABILITIES, REQUIREMENTS) = \
+    SECTIONS = (NODE_TYPE, REQUIREMENTS, CAPABILITIES) = \
                ('node_type', 'requirements', 'capabilities')
 
     def __init__(self, sub_mapping_def, nodetemplates, inputs, outputs,
@@ -102,13 +102,14 @@ class SubstitutionMappings(object):
                 InvalidNodeTypeError(what=node_type_def))
 
     def _validate_inputs(self):
-        """validate the inputs of substitution mappings."""
-
-        # The inputs in service template which provides substutition mappings
-        # must be in properties of node template which is mapped or provide
-        # defualt value. Currently the input.name is not restrict to be the
-        # same as property name in specification, but they should be equal
-        # for current implementation.
+        """validate the inputs of substitution mappings.
+
+        The inputs in service template which provides substutition mappings
+        must be in properties of node template which is mapped or provide
+        defualt value. Currently the input.name is not restrict to be the
+        same as property name in specification, but they should be equal
+        for current implementation.
+        """
 
         # Must provide parameters for required properties of node_type
         # This checking is internal(inside SubstitutionMappings)