From 24991c4ae029c2f5deac636904401ecc619c4a5e Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 29 Aug 2013 17:08:51 -0500 Subject: [PATCH] Add hung job description to email --- teuthology/suite.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/teuthology/suite.py b/teuthology/suite.py index e6534f8b..40bf2d90 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: -- 2.47.3