charmhelpers.core.templating¶
-
charmhelpers.core.templating.
render
(source, target, context, owner='root', group='root', perms=292, templates_dir=None, encoding='UTF-8')¶ Render a template.
The source path, if not absolute, is relative to the templates_dir.
The target path should be absolute.
The context should be a dict containing the values to be replaced in the template.
The owner, group, and perms options will be passed to write_file.
If omitted, templates_dir defaults to the templates folder in the charm.
Note: Using this requires python-jinja2; if it is not installed, calling this will attempt to use charmhelpers.fetch.apt_install to install it.