fixed passing the shebang line as json

This commit is contained in:
Mike Wilkerson 2012-09-05 10:49:26 -04:00
parent 67535af56f
commit 88ad39a4fb

View File

@ -32,4 +32,12 @@ def render(template_file, env='', sls=''):
if not tmp_data.get('result', False):
raise SaltRenderError(tmp_data.get('data',
'Unknown render error in json_mako renderer'))
return json.loads(tmp_data['data'])
# Ensure that we're not passing lines with a shebang in the JSON.
to_return = []
for line in tmp_data['data'].split('\n'):
if line and line[0] != '#!':
to_return.append(line)
to_return = '\n'.join(to_return)
return json.loads(to_return)