1. Adding some new helper files that split off file inclusion, templating, importing, constant usage.

1. Move all datasources to a new sources directory
1. Rename some files to be more consistent with python file/module naming.
This commit is contained in:
Joshua Harlow
2012-06-07 12:42:38 -07:00
parent 63d3091b24
commit 78ce3cbfe0
48 changed files with 224 additions and 0 deletions

17
cloudinit/templater.py Normal file
View File

@@ -0,0 +1,17 @@
import os
from Cheetah.Template import Template
from cloudinit import util
TEMPLATE_DIR = '/etc/cloud/templates/'
def render_to_file(template, outfile, searchList):
contents = Template(file=os.path.join(TEMPLATE_DIR, template),
searchList=[searchList]).respond()
util.write_file(outfile, contents)
def render_string(template, searchList):
return Template(template, searchList=[searchList]).respond()