Changeset 989 for vendor/current/script/autobuild.py
- Timestamp:
- Nov 25, 2016, 8:04:54 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/script/autobuild.py
r988 r989 561 561 562 562 def email_failure(status, failed_task, failed_stage, failed_tag, errstr, 563 elapsed_time, log_base=None ):563 elapsed_time, log_base=None, add_log_tail=True): 564 564 '''send an email to options.email about the failure''' 565 565 elapsed_minutes = elapsed_time / 60.0 … … 599 599 ''' % (log_base, failed_tag, log_base, failed_tag, log_base, top_commit_msg) 600 600 601 if add_log_tail: 602 f = open("%s/%s.stdout" % (gitroot, failed_tag), 'r') 603 lines = f.readlines() 604 log_tail = "".join(lines[-50:]) 605 num_lines = len(lines) 606 if num_lines < 50: 607 # Also include stderr (compile failures) if < 50 lines of stdout 608 f = open("%s/%s.stderr" % (gitroot, failed_tag), 'r') 609 log_tail += "".join(f.readlines()[-(50-num_lines):]) 610 611 text += ''' 612 The last 50 lines of log messages: 613 614 %s 615 ''' % log_tail 616 f.close() 617 601 618 logs = os.path.join(gitroot, 'logs.tar.gz') 602 send_email('autobuild failure on %s for task %s during %s'603 % ( platform.node(), failed_task, failed_stage),619 send_email('autobuild[%s] failure on %s for task %s during %s' 620 % (options.branch, platform.node(), failed_task, failed_stage), 604 621 text, logs) 605 622 … … 632 649 633 650 logs = os.path.join(gitroot, 'logs.tar.gz') 634 send_email('autobuild sucess on %s ' % platform.node(),651 send_email('autobuild[%s] success on %s' % (options.branch, platform.node()), 635 652 text, logs) 636 653 … … 734 751 AUTOBUILD FAILURE 735 752 736 Your autobuild on %s failed after %.1f minutes753 Your autobuild[%s] on %s failed after %.1f minutes 737 754 when trying to test %s with the following error: 738 755 … … 743 760 #################################################################### 744 761 745 ''' % ( platform.node(), elapsed_minutes, failed_task, errstr)762 ''' % (options.branch, platform.node(), elapsed_minutes, failed_task, errstr) 746 763 747 764 cleanup()
Note:
See TracChangeset
for help on using the changeset viewer.