From: Zack Cerza Date: Thu, 29 Aug 2013 22:08:51 +0000 (-0500) Subject: Add hung job description to email X-Git-Tag: 1.1.0~1918^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F62%2Fhead;p=teuthology.git Add hung job description to email --- diff --git a/teuthology/suite.py b/teuthology/suite.py index e6534f8b8..40bf2d904 100644 --- a/teuthology/suite.py +++ b/teuthology/suite.py @@ -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: