]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Add hung job description to email
authorZack Cerza <zack@cerza.org>
Thu, 29 Aug 2013 22:08:51 +0000 (17:08 -0500)
committerZack Cerza <zack@cerza.org>
Thu, 29 Aug 2013 22:08:51 +0000 (17:08 -0500)
teuthology/suite.py

index e6534f8b8addcdbf2309d4841af103e3dd995194..40bf2d904cf2c7d652cde582719eb435940b4973 100644 (file)
@@ -495,7 +495,7 @@ email_templates = {
     'fail_log_templ': "\nlog:    {log}",
     'fail_sentry_templ': "\nsentry: {sentries}",
     'hung_templ': dedent("""\
-        [{job_id}]
+        [{job_id}] {desc}
         """),
     'pass_templ': dedent("""\
         [{job_id}] {desc}
@@ -517,7 +517,18 @@ def build_email_body(name, archive_dir, timeout):
 
         # Unfinished jobs will have no summary.yaml
         if not os.path.exists(summary_file):
-            hung[job] = email_templates['hung_templ'].format(job_id=job)
+            info_file = os.path.join(job_dir, 'info.yaml')
+
+            desc = ''
+            if os.path.exists(info_file):
+                with file(info_file) as f:
+                    info = yaml.safe_load(f)
+                    desc = info['description']
+
+            hung[job] = email_templates['hung_templ'].format(
+                job_id=job,
+                desc=desc,
+            )
             continue
 
         with file(summary_file) as f: