mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #2607 from kjkuan/develop
Fix the py renderer broken by the introduction of render pipes.
This commit is contained in:
commit
1b8889a16d
@ -19,6 +19,7 @@ def render(template, env='', sls='', **kws):
|
||||
|
||||
:rtype: string
|
||||
'''
|
||||
template = kws['slspath']
|
||||
if not os.path.isfile(template):
|
||||
return {}
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user