mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Make sure the email subject and body are strings
compile_template returns StringIO objects.
This commit is contained in:
parent
fc69d08e8e
commit
74563f17ed
1 changed files with 3 additions and 3 deletions
|
@ -151,19 +151,19 @@ def returner(ret):
|
|||
for field in fields:
|
||||
if field in ret:
|
||||
subject += ' {0}'.format(ret[field])
|
||||
subject = compile_template(':string:', rend, renderer, input_data=subject, **ret)
|
||||
subject = compile_template(':string:', rend, renderer, input_data=subject, **ret).getvalue()
|
||||
log.debug("smtp_return: Subject is '{0}'".format(subject))
|
||||
|
||||
template = _options.get('template')
|
||||
if template:
|
||||
content = compile_template(template, rend, renderer, **ret)
|
||||
content = compile_template(template, rend, renderer, **ret).getvalue()
|
||||
else:
|
||||
template = ('id: {{id}}\r\n'
|
||||
'function: {{fun}}\r\n'
|
||||
'function args: {{fun_args}}\r\n'
|
||||
'jid: {{jid}}\r\n'
|
||||
'return: {{return}}\r\n')
|
||||
content = compile_template(':string:', rend, renderer, input_data=template, **ret)
|
||||
content = compile_template(':string:', rend, renderer, input_data=template, **ret).getvalue()
|
||||
|
||||
if HAS_GNUPG and gpgowner:
|
||||
gpg = gnupg.GPG(gnupghome=os.path.expanduser('~{0}/.gnupg'.format(gpgowner)),
|
||||
|
|
Loading…
Add table
Reference in a new issue