From: Zack Cerza Date: Thu, 19 Jun 2014 19:06:21 +0000 (-0400) Subject: Raise ScheduleFailError even if not sending email X-Git-Tag: 1.1.0~1381 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=91c7385988a45f24fc7f495f8a5083c0f6b4df89;p=teuthology.git Raise ScheduleFailError even if not sending email Signed-off-by: Zack Cerza --- diff --git a/teuthology/suite.py b/teuthology/suite.py index f7e6dd2df2..a06b3865d4 100644 --- a/teuthology/suite.py +++ b/teuthology/suite.py @@ -202,16 +202,15 @@ def prepare_and_schedule(owner, name, suite, machine_type, base, def schedule_fail(message, name=None): email = config.results_email - if not email: - return - subject = "Failed to schedule {name}".format(name=name) - msg = MIMEText(message) - msg['Subject'] = subject - msg['From'] = config.results_sending_email - msg['To'] = email - smtp = smtplib.SMTP('localhost') - smtp.sendmail(msg['From'], [msg['To']], msg.as_string()) - smtp.quit() + if email: + subject = "Failed to schedule {name}".format(name=name) + msg = MIMEText(message) + msg['Subject'] = subject + msg['From'] = config.results_sending_email + msg['To'] = email + smtp = smtplib.SMTP('localhost') + smtp.sendmail(msg['From'], [msg['To']], msg.as_string()) + smtp.quit() raise ScheduleFailError(message, name)