From: Richard W.M. Jones Date: Fri, 7 Jul 2017 14:00:14 +0000 (+0100) Subject: send-reports: Truncate content to 50K. X-Git-Url: http://git.annexia.org/?p=patchq.git;a=commitdiff_plain;h=a04569d3fe815bd27481aa5419efc30f3bc09480 send-reports: Truncate content to 50K. --- diff --git a/README b/README index 2e67f3f..954c227 100644 --- a/README +++ b/README @@ -99,6 +99,9 @@ To do: - Allow dependencies between tests (ie. test if the code compiles first before running other tests). + - Send full reports to a website. Requires another queue and another + task to update the website. + Similar projects: - The 0-day test service is a very comprehensive set of tests diff --git a/send-reports.py b/send-reports.py index b526683..122765f 100755 --- a/send-reports.py +++ b/send-reports.py @@ -34,6 +34,11 @@ while True: if config.reply_override is not None: to = [config.reply_override] + # If the content is over 50K then truncate it to the last 50K. + # XXX Upload full logs to a website. + if len(content) > 50000: + content = content[-50000:] + # Construct an email of type text/plain with the body of the # message. msg = MIMEText(content)