diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-07-09 16:41:45 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-07-09 16:41:45 -0400 |
commit | 75af023c864d1b6c4e48788b1b4cf7aad5eb2204 (patch) | |
tree | 2f79d479ee27ecb26faa94b91ea47e10b63c6612 /cloudinit/templater.py | |
parent | 50b9e8b7be096e331eb070c5c48d833b1756463c (diff) | |
download | vyos-cloud-init-75af023c864d1b6c4e48788b1b4cf7aad5eb2204.tar.gz vyos-cloud-init-75af023c864d1b6c4e48788b1b4cf7aad5eb2204.zip |
Revert back to using cheetah + adjust resultant code + templates
At this point there is a mixture of "double hash" cheetah comments and '#*'
cheetah comments.
Diffstat (limited to 'cloudinit/templater.py')
-rw-r--r-- | cloudinit/templater.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/cloudinit/templater.py b/cloudinit/templater.py index c4259fa0..77af1270 100644 --- a/cloudinit/templater.py +++ b/cloudinit/templater.py @@ -20,13 +20,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -from tempita import Template +from Cheetah.Template import Template from cloudinit import util def render_from_file(fn, params): - return render_string(util.load_file(fn), params, name=fn) + return render_string(util.load_file(fn), params) def render_to_file(fn, outfn, params, mode=0644): @@ -34,8 +34,7 @@ def render_to_file(fn, outfn, params, mode=0644): util.write_file(outfn, contents, mode=mode) -def render_string(content, params, name=None): - tpl = Template(content, name=name) +def render_string(content, params): if not params: - params = dict() - return tpl.substitute(params) + params = {} + return Template(content, searchList=[params]).respond() |