From f416d7ba961edddfd956b556ed6566bf48824bf5 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Fri, 1 Sep 2017 15:16:00 +0800 Subject: Support version of tosca_simple_yaml_1_1 Currently tosca-parser only support tosca_version_1_0, this patch will enable it to support tosca_version_1_1. This requirement is from ONAP, but not need to submit to OpenStack currently JIRA:PARSER-146 Change-Id: If1bc470e3f2d18a606b312425241f27be33b65b4 Signed-off-by: shangxdy --- tosca2heat/tosca-parser/toscaparser/tosca_template.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tosca2heat/tosca-parser/toscaparser/tosca_template.py') diff --git a/tosca2heat/tosca-parser/toscaparser/tosca_template.py b/tosca2heat/tosca-parser/toscaparser/tosca_template.py index 3301999..ac534dc 100644 --- a/tosca2heat/tosca-parser/toscaparser/tosca_template.py +++ b/tosca2heat/tosca-parser/toscaparser/tosca_template.py @@ -56,11 +56,13 @@ YAML_LOADER = toscaparser.utils.yamlparser.load_yaml class ToscaTemplate(object): exttools = ExtTools() - VALID_TEMPLATE_VERSIONS = ['tosca_simple_yaml_1_0'] + VALID_TEMPLATE_VERSIONS = ['tosca_simple_yaml_1_0', + 'tosca_simple_yaml_1_1'] VALID_TEMPLATE_VERSIONS.extend(exttools.get_versions()) - ADDITIONAL_SECTIONS = {'tosca_simple_yaml_1_0': SPECIAL_SECTIONS} + ADDITIONAL_SECTIONS = {'tosca_simple_yaml_1_0': SPECIAL_SECTIONS, + 'tosca_simple_yaml_1_1': SPECIAL_SECTIONS} ADDITIONAL_SECTIONS.update(exttools.get_sections()) @@ -272,7 +274,8 @@ class ToscaTemplate(object): what=version, valid_versions=', '. join(self.VALID_TEMPLATE_VERSIONS))) else: - if version != 'tosca_simple_yaml_1_0': + if (version != 'tosca_simple_yaml_1_0' and + version != 'tosca_simple_yaml_1_1'): update_definitions(version) def _get_path(self, path): -- cgit 1.2.3-korg