| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Defines common functionality used for generating e-mail to sheriffs.""" | 5 """Defines common functionality used for generating e-mail to sheriffs.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 import re | 8 import re |
| 9 import urllib | 9 import urllib |
| 10 | 10 |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 'alerts_link': _ALL_ALERTS_LINK % urllib.quote(sheriff_name), | 313 'alerts_link': _ALL_ALERTS_LINK % urllib.quote(sheriff_name), |
| 314 'bug_link': bug_url, | 314 'bug_link': bug_url, |
| 315 } | 315 } |
| 316 return results | 316 return results |
| 317 | 317 |
| 318 | 318 |
| 319 def GetBisectFYITryJobEmailReport(job, message): | 319 def GetBisectFYITryJobEmailReport(job, message): |
| 320 """Gets the contents of the email to send once a bisect FYI job completes.""" | 320 """Gets the contents of the email to send once a bisect FYI job completes.""" |
| 321 results_data = job.results_data | 321 results_data = job.results_data |
| 322 subject_dict = { | 322 subject_dict = { |
| 323 'bot': results_data['bisect_bot'], | 323 'bot': job.bot, |
| 324 'test_name': job.job_name, | 324 'test_name': job.job_name, |
| 325 } | 325 } |
| 326 report_dict = { | 326 report_dict = { |
| 327 'message': message, | 327 'message': message, |
| 328 'bot': results_data['bisect_bot'], | 328 'bot': job.bot, |
| 329 'job_url': results_data['buildbot_log_url'], | 329 'job_url': results_data['buildbot_log_url'], |
| 330 'test_name': job.job_name, | 330 'test_name': job.job_name, |
| 331 'config': job.config if job.config else 'Undefined', | 331 'config': job.config if job.config else 'Undefined', |
| 332 'errors': results_data.get('errors'), | 332 'errors': results_data.get('errors'), |
| 333 'results': results_data.get('results'), | 333 'results': results_data.get('results'), |
| 334 } | 334 } |
| 335 | 335 |
| 336 html = _BISECT_FYI_EMAIL_HTML_BODY % report_dict | 336 html = _BISECT_FYI_EMAIL_HTML_BODY % report_dict |
| 337 text = _BISECT_FYI_EMAIL_TEXT_BODY % report_dict | 337 text = _BISECT_FYI_EMAIL_TEXT_BODY % report_dict |
| 338 subject = _BISECT_FYI_EMAIL_SUBJECT % subject_dict | 338 subject = _BISECT_FYI_EMAIL_SUBJECT % subject_dict |
| 339 return {'subject': subject, 'html': html, 'body': text} | 339 return {'subject': subject, 'html': html, 'body': text} |
| OLD | NEW |