From 5559b0c06930deb1c7831efe599a1036574f50b3 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Sun, 14 Aug 2016 02:16:28 +0800 Subject: Add input validation in substitution_mapping class Add input 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) The properties of substituted node template which be mapped must be in the inputs of nested service template which defines substutition mappings; 2) The inputs of nested service template which are not in properties of the substituted node template must have default values. 3) If the properties of node_type is required and no default value, must provide inputs for them; 4) Property names and the input names must be the same. JIRA:PARSER-79 Change-Id: Ie4664fe17c8279ad531ac9acec057f98d4e9281a Signed-off-by: shangxdy --- .../tests/data/topology_template/databasesubsystem.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tosca2heat/tosca-parser/toscaparser/tests/data') diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/databasesubsystem.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/databasesubsystem.yaml index 22eb259..ebf1856 100644 --- a/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/databasesubsystem.yaml +++ b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/databasesubsystem.yaml @@ -12,15 +12,15 @@ topology_template: description: Template of a database including its hosting stack. inputs: - db_user: + user: type: string description: the user name of database. default: test - db_port: + port: type: integer description: the port of database. default: 3306 - db_name: + name: type: string description: the name of database. default: test @@ -40,9 +40,9 @@ topology_template: db_app: type: tosca.nodes.Database properties: - user: { get_input: db_user } - port: { get_input: db_port } - name: { get_input: db_name } + user: { get_input: user } + port: { get_input: port } + name: { get_input: name } capabilities: database_endpoint: properties: -- cgit 1.2.3-korg