exc_tracker: disable send-email if mail server is not configured.

This commit is contained in:
Marcin Kuzminski 2020-04-06 18:23:10 +02:00
parent 90b8007935
commit 49ac57fa47

View file

@ -95,9 +95,9 @@ def _store_exception(exc_id, exc_type_name, exc_traceback, prefix, send_email=No
if send_email is None:
# NOTE(marcink): read app config unless we specify explicitly
send_email = app.CONFIG.get('exception_tracker.send_email', False)
mail_server = app.CONFIG.get('smtp_server') or None
send_email = send_email and mail_server
mail_server = app.CONFIG.get('smtp_server') or None
send_email = send_email and mail_server
if send_email:
try:
send_exc_email(exc_id, exc_type_name)