]> review.fuel-infra Code Review - openstack-build/heat-build.git/commit
Add Fn::Replace template function.
authorSteve Baker <sbaker@redhat.com>
Wed, 5 Jun 2013 01:41:36 +0000 (13:41 +1200)
committerSteve Baker <sbaker@redhat.com>
Sun, 9 Jun 2013 23:41:27 +0000 (11:41 +1200)
commit83cd934beb2f8657f59d2e7219b71f8b8df5a657
tree1932d26385e35f9b346115590930348aa07ef82c
parent23768d8080d24352639a3d396b828b79ccaafdf0
Add Fn::Replace template function.

This is implemented with python str.replace

For yaml templates, this should be used as a better alternative to
Fn::Join: ['', [...]]

For json templates, the following common pattern:
"Fn::Join": ["", ["line 1\n", ... "line 2\n"]]
could now become more maintainable as:
"Fn::Replace": [{...}, "Fn::Join": ["\n", ["line 1", ... "line 2"]]]

Implements blueprint template-string-function
Implements blueprint bash-environment-function

Change-Id: Ie4817b1d98dd6d6390e086da9b582d33415a0d9f
heat/engine/parser.py
heat/engine/template.py
heat/tests/test_parser.py