[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [torflow/master] Bug #4330: Have snakeinspector attach files if they exist
commit 63a3091397ffd4f4eae27f18c8103bb0ebfab7b1
Author: Mike Perry <mikeperry-git@xxxxxxxxxx>
Date: Sat Nov 19 15:47:34 2011 -0800
Bug #4330: Have snakeinspector attach files if they exist
---
NetworkScanners/ExitAuthority/snakeinspector.py | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/NetworkScanners/ExitAuthority/snakeinspector.py b/NetworkScanners/ExitAuthority/snakeinspector.py
index 608df54..c359719 100755
--- a/NetworkScanners/ExitAuthority/snakeinspector.py
+++ b/NetworkScanners/ExitAuthority/snakeinspector.py
@@ -274,7 +274,20 @@ def main(argv):
text += traceback.format_exc()
# TODO: Attach files? Or is that too much.. Maybe serve
# them via http and include links?
- send_mail(mail_from_email, mail_to_email, subject, text)
+ if isinstance(r, HttpTestResult) or \
+ isinstance(r, JsTestResult) or \
+ isinstance(r, HtmlTestResult):
+ attach = []
+ if r.content:
+ attach.append(r.content)
+ if r.content_old:
+ attach.append(r.content_old)
+ if r.content_exit:
+ attach.append(r.content_exit)
+ send_mail(mail_from_email, mail_to_email, subject, text,
+ attach)
+ else:
+ send_mail(mail_from_email, mail_to_email, subject, text)
if __name__ == "__main__":
main(sys.argv)
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits