diff --git a/toscaparser/elements/tosca_type_validation.py b/toscaparser/elements/tosca_type_validation.py index 899c718..16764bc 100644 --- a/toscaparser/elements/tosca_type_validation.py +++ b/toscaparser/elements/tosca_type_validation.py @@ -22,13 +22,12 @@ class TypeValidation(object): DSL_DEFINITIONS, NODE_TYPES, REPOSITORIES, DATA_TYPES, ARTIFACT_TYPES, GROUP_TYPES, RELATIONSHIP_TYPES, CAPABILITY_TYPES, - INTERFCAE_TYPES, POLICY_TYPES, DATATYPE_DEFINITIONS) = \ - ('tosca_definitions_version', 'description', - 'imports', 'dsl_definitions', 'node_types', - 'repositories', 'data_types', 'group_types', - 'artifact_types', 'relationship_types', - 'capability_types', 'interface_types', - 'policy_types', 'datatype_definitions') + INTERFACE_TYPES, POLICY_TYPES) = \ + ('tosca_definitions_version', 'description', 'imports', + 'dsl_definitions', 'node_types', 'repositories', + 'data_types', 'artifact_types', 'group_types', + 'relationship_types', 'capability_types', + 'interface_types', 'policy_types') VALID_TEMPLATE_VERSIONS = ['tosca_simple_yaml_1_0'] exttools = ExtTools() VALID_TEMPLATE_VERSIONS.extend(exttools.get_versions()) diff --git a/toscaparser/tests/data/datatypes/custom_datatype_def.yaml b/toscaparser/tests/data/datatypes/custom_datatype_def.yaml index 4b7da71..455e406 100644 --- a/toscaparser/tests/data/datatypes/custom_datatype_def.yaml +++ b/toscaparser/tests/data/datatypes/custom_datatype_def.yaml @@ -10,7 +10,7 @@ node_types: people: type: tosca.my.datatypes.People -datatype_definitions: +data_types: tosca.my.datatypes.PeopleBase: properties: name: diff --git a/toscaparser/tests/data/datatypes/test_custom_datatypes_in_current_template.yaml b/toscaparser/tests/data/datatypes/test_custom_datatypes_in_current_template.yaml index aefe862..edc755b 100644 --- a/toscaparser/tests/data/datatypes/test_custom_datatypes_in_current_template.yaml +++ b/toscaparser/tests/data/datatypes/test_custom_datatypes_in_current_template.yaml @@ -10,7 +10,7 @@ node_types: people: type: tosca.my.datatypes.People -datatype_definitions: +data_types: tosca.my.datatypes.PeopleBase: properties: name: @@ -62,4 +62,4 @@ topology_template: contact_phone: '123456789'} - {contact_name: Jerry, contact_email: jerry@email.com, - contact_phone: '321654987'} \ No newline at end of file + contact_phone: '321654987'} diff --git a/toscaparser/tosca_template.py b/toscaparser/tosca_template.py index 7472278..8e427db 100644 --- a/toscaparser/tosca_template.py +++ b/toscaparser/tosca_template.py @@ -34,13 +34,13 @@ SECTIONS = (DEFINITION_VERSION, DEFAULT_NAMESPACE, TEMPLATE_NAME, TOPOLOGY_TEMPLATE, TEMPLATE_AUTHOR, TEMPLATE_VERSION, DESCRIPTION, IMPORTS, DSL_DEFINITIONS, NODE_TYPES, RELATIONSHIP_TYPES, RELATIONSHIP_TEMPLATES, - CAPABILITY_TYPES, ARTIFACT_TYPES, DATATYPE_DEFINITIONS, + CAPABILITY_TYPES, ARTIFACT_TYPES, DATA_TYPES, POLICY_TYPES, GROUP_TYPES) = \ ('tosca_definitions_version', 'tosca_default_namespace', 'template_name', 'topology_template', 'template_author', 'template_version', 'description', 'imports', 'dsl_definitions', 'node_types', 'relationship_types', 'relationship_templates', - 'capability_types', 'artifact_types', 'datatype_definitions', + 'capability_types', 'artifact_types', 'data_types', 'policy_types', 'group_types') # Sections that are specific to individual template definitions SPECIAL_SECTIONS = (METADATA) = ('metadata') @@ -145,7 +145,7 @@ class ToscaTemplate(object): def _get_all_custom_defs(self, imports=None): types = [IMPORTS, NODE_TYPES, CAPABILITY_TYPES, RELATIONSHIP_TYPES, - DATATYPE_DEFINITIONS, POLICY_TYPES, GROUP_TYPES] + DATA_TYPES, POLICY_TYPES, GROUP_TYPES] custom_defs_final = {} custom_defs = self._get_custom_types(types, imports) if custom_defs: