From 674a62ae9bbda32837874b48d4fb9a43199d8706 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Thu, 5 Mar 2020 22:04:48 -0500 Subject: [PATCH] Add template version 2021-04-16 for Wallaby Change-Id: I57047682cfa82ba6ca4affff54fab5216e9ba51c Story: 2007388 --- doc/source/template_guide/hot_spec.rst | 40 ++++++++++++++- heat/engine/hot/template.py | 51 +++++++++++++++++++ heat/tests/test_template.py | 4 +- .../functional/test_template_versions.py | 3 +- setup.cfg | 2 + 5 files changed, 96 insertions(+), 4 deletions(-) diff --git a/doc/source/template_guide/hot_spec.rst b/doc/source/template_guide/hot_spec.rst index c81f48eea5..694b22e465 100644 --- a/doc/source/template_guide/hot_spec.rst +++ b/doc/source/template_guide/hot_spec.rst @@ -376,7 +376,45 @@ The complete list of supported condition functions is:: ------------------- The key with value ``2018-08-31`` or ``rocky`` indicates that the YAML document is a HOT template and it may contain features added and/or removed -up until the Queens release. The complete list of supported functions is:: +up until the Rocky release. The complete list of supported functions is:: + + digest + filter + get_attr + get_file + get_param + get_resource + list_join + make_url + list_concat + list_concat_unique + contains + map_merge + map_replace + repeat + resource_facade + str_replace + str_replace_strict + str_replace_vstrict + str_split + yaql + if + +The complete list of supported condition functions is:: + + equals + get_param + not + and + or + yaql + contains + +2021-04-16 | wallaby +-------------------- +The key with value ``2021-04-16`` or ``wallaby`` indicates that the YAML +document is a HOT template and it may contain features added and/or removed +up until the Wallaby release. The complete list of supported functions is:: digest filter diff --git a/heat/engine/hot/template.py b/heat/engine/hot/template.py index f6edb51c7d..976734416f 100644 --- a/heat/engine/hot/template.py +++ b/heat/engine/hot/template.py @@ -758,3 +758,54 @@ class HOTemplate20180831(HOTemplate20180302): 'yaql': hot_funcs.Yaql, 'contains': hot_funcs.Contains } + + +class HOTemplate20210416(HOTemplate20180831): + functions = { + 'get_attr': hot_funcs.GetAttAllAttributes, + 'get_file': hot_funcs.GetFile, + 'get_param': hot_funcs.GetParam, + 'get_resource': hot_funcs.GetResource, + 'list_join': hot_funcs.JoinMultiple, + 'repeat': hot_funcs.RepeatWithNestedLoop, + 'resource_facade': hot_funcs.ResourceFacade, + 'str_replace': hot_funcs.ReplaceJson, + + # functions added in 2015-04-30 + 'digest': hot_funcs.Digest, + + # functions added in 2015-10-15 + 'str_split': hot_funcs.StrSplit, + + # functions added in 2016-04-08 + 'map_merge': hot_funcs.MapMerge, + + # functions added in 2016-10-14 + 'yaql': hot_funcs.Yaql, + 'map_replace': hot_funcs.MapReplace, + 'if': hot_funcs.If, + + # functions added in 2017-02-24 + 'filter': hot_funcs.Filter, + 'str_replace_strict': hot_funcs.ReplaceJsonStrict, + + # functions added in 2017-09-01 + 'make_url': hot_funcs.MakeURL, + 'list_concat': hot_funcs.ListConcat, + 'str_replace_vstrict': hot_funcs.ReplaceJsonVeryStrict, + 'list_concat_unique': hot_funcs.ListConcatUnique, + 'contains': hot_funcs.Contains, + + # functions removed from 2015-10-15 + 'Fn::Select': hot_funcs.Removed, + + # functions removed from 2014-10-16 + 'Fn::GetAZs': hot_funcs.Removed, + 'Fn::Join': hot_funcs.Removed, + 'Fn::Split': hot_funcs.Removed, + 'Fn::Replace': hot_funcs.Removed, + 'Fn::Base64': hot_funcs.Removed, + 'Fn::MemberListToMap': hot_funcs.Removed, + 'Fn::ResourceFacade': hot_funcs.Removed, + 'Ref': hot_funcs.Removed, + } diff --git a/heat/tests/test_template.py b/heat/tests/test_template.py index 106a466a8e..bb0abfb797 100644 --- a/heat/tests/test_template.py +++ b/heat/tests/test_template.py @@ -733,9 +733,9 @@ class TemplateTest(common.HeatTestCase): valid_versions = ['2013-05-23', '2014-10-16', '2015-04-30', '2015-10-15', '2016-04-08', '2016-10-14', '2017-02-24', '2017-09-01', - '2018-03-02', '2018-08-31', + '2018-03-02', '2018-08-31', '2021-04-16', 'newton', 'ocata', 'pike', - 'queens', 'rocky'] + 'queens', 'rocky', 'wallaby'] ex_error_msg = ('The template version is invalid: ' '"heat_template_version: 2012-12-12". ' '"heat_template_version" should be one of: %s' diff --git a/heat_integrationtests/functional/test_template_versions.py b/heat_integrationtests/functional/test_template_versions.py index 08b169844d..013064c009 100644 --- a/heat_integrationtests/functional/test_template_versions.py +++ b/heat_integrationtests/functional/test_template_versions.py @@ -26,7 +26,8 @@ class TemplateVersionTest(functional_base.FunctionalTestsBase): "2017-02-24", "ocata", "2017-09-01", "pike", "2018-03-02", "queens", - "2018-08-31", "rocky"] + "2018-08-31", "rocky", + "2021-04-16", "wallaby"] for template in template_versions: self.assertIn(template.version.split(".")[1], supported_template_versions) diff --git a/setup.cfg b/setup.cfg index 648a88b096..13668622a0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -202,6 +202,8 @@ heat.templates = heat_template_version.queens = heat.engine.hot.template:HOTemplate20180302 heat_template_version.2018-08-31 = heat.engine.hot.template:HOTemplate20180831 heat_template_version.rocky = heat.engine.hot.template:HOTemplate20180831 + heat_template_version.2021-04-16 = heat.engine.hot.template:HOTemplate20210416 + heat_template_version.wallaby = heat.engine.hot.template:HOTemplate20210416 [compile_catalog] directory = heat/locale