]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Raise ScheduleFailError even if not sending email
authorZack Cerza <zack@cerza.org>
Thu, 19 Jun 2014 19:06:21 +0000 (15:06 -0400)
committerZack Cerza <zack@cerza.org>
Wed, 25 Jun 2014 18:54:23 +0000 (12:54 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/suite.py

index f7e6dd2df27fbdd283ca203d51925922b15d2e3e..a06b3865d477055b2bb345412b34a267f2efad54 100644 (file)
@@ -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)