Skip to content
Snippets Groups Projects
Commit c22efcf7 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Fixed hostname decoding.

parent ea392583
No related branches found
No related tags found
No related merge requests found
...@@ -154,6 +154,7 @@ class Tester(): ...@@ -154,6 +154,7 @@ class Tester():
if not hostname: if not hostname:
log('Failed to get hostname (required to send email).') log('Failed to get hostname (required to send email).')
return 1 return 1
hostname = hostname.decode('utf-8')
recipients = utils.get_conf('EMAIL_ADMINS') recipients = utils.get_conf('EMAIL_ADMINS')
if not recipients: if not recipients:
log('No recipients defined for email sending. Set a value for EMAIL_ADMINS.') log('No recipients defined for email sending. Set a value for EMAIL_ADMINS.')
...@@ -181,7 +182,7 @@ Content-transfer-encoding: utf-8 ...@@ -181,7 +182,7 @@ Content-transfer-encoding: utf-8
%(log_content)s''' % dict( %(log_content)s''' % dict(
boundary=boundary, boundary=boundary,
hostname=hostname.decode('utf-8'), hostname=hostname,
recipients=recipients, recipients=recipients,
status='OK' if exit_code == 0 else 'KO', status='OK' if exit_code == 0 else 'KO',
date=now.strftime('%Y-%m-%d %H:%M:%S'), date=now.strftime('%Y-%m-%d %H:%M:%S'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment