summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2016-03-14 14:18:54 +1300
committerAndrew Bartlett <abartlet@samba.org>2016-03-22 11:39:38 +0100
commitaab2f39bb7ff330fbb01da4021c096e69a429d2e (patch)
treef8f6d40494c995636cb37545093f37fca64f4fec /script
parent5e4f39ad60f4cf0bd3a2f793e4572b09163a4ce1 (diff)
downloadsamba-aab2f39bb7ff330fbb01da4021c096e69a429d2e.tar.gz
autobuild: Return the last 50 log lines
This means that you don't have to deal with tars for quickly determining the cause of a failure. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Mar 22 11:39:38 CET 2016 on sn-devel-144
Diffstat (limited to 'script')
-rwxr-xr-xscript/autobuild.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/script/autobuild.py b/script/autobuild.py
index 4cad9203339..13be1b6a856 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -566,7 +566,7 @@ def send_email(subject, text, log_tar):
s.quit()
def email_failure(status, failed_task, failed_stage, failed_tag, errstr,
- elapsed_time, log_base=None):
+ elapsed_time, log_base=None, add_log_tail=True):
'''send an email to options.email about the failure'''
elapsed_minutes = elapsed_time / 60.0
user = os.getenv("USER")
@@ -604,6 +604,17 @@ The top commit for the tree that was built was:
''' % (log_base, failed_tag, log_base, failed_tag, log_base, top_commit_msg)
+ if add_log_tail:
+ f = open("%s/%s.stdout" % (log_base, failed_tag), 'r')
+ log_tail = "".join(f.readlines()[-50:])
+
+ text += '''
+The last 50 lines of log messages:
+
+%s
+ ''' % log_tail
+ f.close()
+
logs = os.path.join(gitroot, 'logs.tar.gz')
send_email('autobuild failure on %s for task %s during %s'
% (platform.node(), failed_task, failed_stage),