]> review.fuel-infra Code Review - openstack-build/heat-build.git/commit
Implement Fn::MemberListToMap
authorAngus Salkeld <asalkeld@redhat.com>
Thu, 22 Aug 2013 22:31:54 +0000 (08:31 +1000)
committerAngus Salkeld <asalkeld@redhat.com>
Fri, 23 Aug 2013 00:40:10 +0000 (10:40 +1000)
commit76281f4fa5d7741520b7dfb1baf199cd162c9bfc
tree5e6d607d3187f4931548cf52856e3f9a3043ead6
parent4654f68e841b56e2f18aca71521e8429e3d5abfe
Implement Fn::MemberListToMap

This is to allow the CloudWatch::Alarm to be implemented as
a resource template. The Dimensions need to be converted
from [{Name: bla, Value: foo}] into a normal dict.

So we define the Dimensions as a CommaDelimitedList in the template,
then in TemplateResource we see that the property is a list of dicts
and convert it into the aws style memberlist
 '.member.0.Name=bla,.member.0.Value=green'
then in the CW template we can do the following:

matching_metadata:
  "Fn::MemberListToMap": [Name, Value, {"Fn::   Split": [",",
{Ref: Dimensions}]}]

Note: this in not a single case usage as we can use this for the Tags
property that is in a lot of other resources.

Change-Id: I68910c51eaeb0857531028e87b89b9192db4c8ba
doc/source/template_guide/functions.rst
heat/engine/parser.py
heat/engine/resources/template_resource.py
heat/engine/template.py
heat/tests/test_parser.py