Merge pull request #2607 from kjkuan/develop

Fix the py renderer broken by the introduction of render pipes.
This commit is contained in:
Thomas S Hatch 2012-11-16 19:36:50 -08:00
commit 1b8889a16d
3 changed files with 4 additions and 6 deletions

View File

@ -19,6 +19,7 @@ def render(template, env='', sls='', **kws):
:rtype: string
'''
template = kws['slspath']
if not os.path.isfile(template):
return {}

View File

@ -261,9 +261,7 @@ def render(template_file, env='', sls='', argline='', **kws):
name, rd_argline = (args[0] + ' ').split(' ', 1)
render_data = renderers[name] # eg, the yaml renderer
if ('-o', '') in opts:
if name == 'yaml' and (sys.version_info > (2, 6) or
(sys.version_info < (2, 7) and
HAS_ORDERED_DICT)):
if name == 'yaml':
IMPLICIT_REQUIRE = True
rd_argline = '-o ' + rd_argline
else:

View File

@ -54,10 +54,9 @@ def compile_template(template, renderers, default, env='', sls=''):
input_data = StringIO(input_data)
for render, argline in render_pipe:
render_kwargs = dict(renderers=renderers, slspath=template)
if argline:
render_kwargs = dict(renderers=renderers, argline=argline)
else:
render_kwargs = dict(renderers=renderers)
render_kwargs['argline'] = argline
ret = render(input_data, env, sls, **render_kwargs)
if ret is None:
# The file is empty or is being written elsewhere