summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/tosca_template.py
diff options
context:
space:
mode:
authorshangxdy <shang.xiaodong@zte.com.cn>2017-09-01 15:16:00 +0800
committershangxdy <shang.xiaodong@zte.com.cn>2017-09-05 10:50:24 +0800
commitf416d7ba961edddfd956b556ed6566bf48824bf5 (patch)
tree52191de4969ab1ab868aa7480285798448a7b09e /tosca2heat/tosca-parser/toscaparser/tosca_template.py
parent6eac11f48f8b664af928620bf2661987aa318725 (diff)
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 <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/tosca_template.py')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tosca_template.py9
1 files changed, 6 insertions, 3 deletions
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):