mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
fixed passing the shebang line as json
This commit is contained in:
parent
67535af56f
commit
88ad39a4fb
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user