From: <bu...@us...> - 2009-08-30 13:51:25
|
Revision: 739 http://fail2ban.svn.sourceforge.net/fail2ban/?rev=739&view=rev Author: buanzo Date: 2009-08-30 13:51:17 +0000 (Sun, 30 Aug 2009) Log Message: ----------- added 'unexpected communication error' fix to ChangeLog. Added formatExceptionInfo to server/asyncserver.py We should move that function to a helpers module. Modified Paths: -------------- branches/FAIL2BAN-0_8/ChangeLog branches/FAIL2BAN-0_8/server/asyncserver.py Modified: branches/FAIL2BAN-0_8/ChangeLog =================================================================== --- branches/FAIL2BAN-0_8/ChangeLog 2009-08-30 13:36:04 UTC (rev 738) +++ branches/FAIL2BAN-0_8/ChangeLog 2009-08-30 13:51:17 UTC (rev 739) @@ -9,6 +9,8 @@ ver. 0.8.4 (2009/??/??) - stable ---------- +- Fixed the 'unexpected communication error' problem by means of + use_poll=False in Python >= 2.6. - Merged patches from Debian package. Thanks to Yaroslav Halchenko. - Use current day and month instead of Jan 1st if both are not available in the log. Thanks to Andreas Itzchak Rehberg. Modified: branches/FAIL2BAN-0_8/server/asyncserver.py =================================================================== --- branches/FAIL2BAN-0_8/server/asyncserver.py 2009-08-30 13:36:04 UTC (rev 738) +++ branches/FAIL2BAN-0_8/server/asyncserver.py 2009-08-30 13:51:17 UTC (rev 739) @@ -30,6 +30,19 @@ # Gets the instance of the logger. logSys = logging.getLogger("fail2ban.server") +# we should move this to some sort of helper functions module + +def formatExceptionInfo(): + """ Author: Arturo 'Buanzo' Busleiman """ + import sys + cla, exc = sys.exc_info()[:2] + excName = cla.__name__ + try: + excArgs = exc.__dict__["args"] + except KeyError: + excArgs = str(exc) + return (excName, excArgs) + ## # Request handler class. # @@ -69,7 +82,9 @@ self.close_when_done() def handle_error(self): - logSys.error("Unexpected communication error") + e1,e2 = formatExceptionInfo() + logSys.error("Unexpected communication error: "+e2) + logSys.error(traceback.format_exc().splitlines()) self.close() ## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |