Merge "Add a new HOT template version for Ocata"

This commit is contained in:
Jenkins 2016-09-28 03:44:24 +00:00 committed by Gerrit Code Review
commit 38b3d4349e
5 changed files with 83 additions and 11 deletions

View File

@ -31,9 +31,9 @@ Status
~~~~~~
HOT is considered reliable, supported, and standardized as of our
Icehouse (April 2014) release. The Heat core team may make improvements
to the standard, which very likely would be backward compatible. The template
format is also versioned. Since Juno release, Heat supports multiple
Icehouse (April 2014) release. The Heat core team may make improvements
to the standard, which very likely would be backward compatible. The template
format is also versioned. Since Juno release, Heat supports multiple
different versions of the HOT specification.
Template structure
@ -141,8 +141,8 @@ for the ``heat_template_version`` key:
----------
The key with value ``2014-10-16`` indicates that the YAML document is a HOT
template and it may contain features added and/or removed up until the Juno
release. This version removes most CFN functions that were supported in
the Icehouse release, i.e. the ``2013-05-23`` version. So the supported
release. This version removes most CFN functions that were supported in
the Icehouse release, i.e. the ``2013-05-23`` version. So the supported
functions now are::
get_attr
@ -200,7 +200,7 @@ for the ``heat_template_version`` key:
----------
The key with value ``2016-04-08`` indicates that the YAML document is a HOT
template and it may contain features added and/or removed up until the
Mitaka release. This version also adds the ``map_merge`` function which
Mitaka release. This version also adds the ``map_merge`` function which
can be used to merge the contents of maps. The complete list of supported
functions is::
@ -220,7 +220,7 @@ for the ``heat_template_version`` key:
-------------------
The key with value ``2016-10-14`` or ``newton`` indicates that the YAML
document is a HOT template and it may contain features added and/or removed
up until the Newton release. This version adds the ``yaql`` function which
up until the Newton release. This version adds the ``yaql`` function which
can be used for evaluation of complex expressions, the ``map_replace``
function that can do key/value replacements on a mapping, and the ``if``
function which can be used to return corresponding value based on condition
@ -255,6 +255,35 @@ for the ``heat_template_version`` key:
and
or
2017-02-24 | ocata
-------------------
The key with value ``2017-02-24`` or ``ocata`` indicates that the YAML
document is a HOT template and it may contain features added and/or removed
up until the Ocata release. The complete list of supported functions is::
digest
get_attr
get_file
get_param
get_resource
list_join
map_merge
map_replace
repeat
resource_facade
str_replace
str_split
yaql
if
The complete list of supported condition functions is::
equals
get_param
not
and
or
.. _hot_spec_parameter_groups:
Parameter groups section
@ -842,7 +871,7 @@ expression
or
Note: In condition functions, you can reference a value from an input
parameter, but you cannot reference resource or its attribute. We support
parameter, but you cannot reference resource or its attribute. We support
referencing other conditions (by condition name) in condition functions.
An example of conditions section definition
@ -1111,7 +1140,7 @@ get_resource
The ``get_resource`` function references another resource within the
same template. At runtime, it is resolved to reference the ID of the referenced
resource, which is resource type specific. For example, a reference to a
floating IP resource returns the respective IP address at runtime. The syntax
floating IP resource returns the respective IP address at runtime. The syntax
of the ``get_resource`` function is
.. code-block:: yaml

View File

@ -509,3 +509,43 @@ class HOTemplate20161014(HOTemplate20160408):
function.Function),
'string_or_boolean',
name, data, parse_cond))
class HOTemplate20170224(HOTemplate20161014):
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.RepeatWithMap,
'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 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,
}

View File

@ -728,7 +728,7 @@ class TemplateTest(common.HeatTestCase):
template.Template, invalid_hot_version_tmp)
valid_versions = ['2013-05-23', '2014-10-16',
'2015-04-30', '2015-10-15', '2016-04-08',
'2016-10-14', 'newton']
'2016-10-14', '2017-02-24', 'newton', 'ocata']
ex_error_msg = ('The template version is invalid: '
'"heat_template_version: 2012-12-12". '
'"heat_template_version" should be one of: %s'

View File

@ -54,7 +54,8 @@ class TemplateAPITest(functional_base.FunctionalTestsBase):
supported_template_versions = ["2013-05-23", "2014-10-16",
"2015-04-30", "2015-10-15",
"2012-12-12", "2010-09-09",
"2016-04-08", "2016-10-14", "newton"]
"2016-04-08", "2016-10-14", "newton",
"2017-02-24", "ocata"]
for template in template_versions:
self.assertIn(template.version.split(".")[1],
supported_template_versions)

View File

@ -157,6 +157,8 @@ heat.templates =
heat_template_version.2016-04-08 = heat.engine.hot.template:HOTemplate20160408
heat_template_version.2016-10-14 = heat.engine.hot.template:HOTemplate20161014
heat_template_version.newton = heat.engine.hot.template:HOTemplate20161014
heat_template_version.2017-02-24 = heat.engine.hot.template:HOTemplate20170224
heat_template_version.ocata = heat.engine.hot.template:HOTemplate20170224
tempest.test_plugins =
heat_tests = heat_integrationtests.plugin:HeatTempestPlugin