summaryrefslogtreecommitdiff
path: root/fail2ban/helpers.py
diff options
context:
space:
mode:
authorYaroslav Halchenko <debian@onerussian.com>2013-05-13 12:25:17 -0400
committerYaroslav Halchenko <debian@onerussian.com>2013-05-13 12:29:41 -0400
commitf5a8a8ac7c41a784d203e74864b79cfc354c24de (patch)
tree59e63c8ee0edef4e713ea4aefa90fe3e83a6dec9 /fail2ban/helpers.py
parent709b437b7da70dcbf8fa9eae595d0fdd9b864ab6 (diff)
parent152c619dc401e29089b7a2220eff6240758f3eb3 (diff)
downloadfail2ban-f5a8a8ac7c41a784d203e74864b79cfc354c24de.tar.gz
Merge tag '0.8.9' into 0.9 (quite a bit of conflicts "resolved")
Release 0.8.9 * tag '0.8.9': BF: add missing files to MANIFEST (I think we shoult not rely on sdist anyways -- 'git tag' tarballs are more thorough ;) ) All the (version) updates for the release of 0.8.9 BF: (travis) relax the test for needed to be presented installed directories -- allow new BF: (travis) if tests ran under coverage -- there is a traceback parts to report (thus > would be present) ENH: also print the failing traceback line in case of failure ENH: include explicit list of new files which should not be there upon "install --root" ENH: now we know that logging handlers closing was still buggy in 2.6.2 ENH: issue a warning if jail name is longer than 19 symbols (Close #222) DOC: inline commends with ';' are in effect only if ';' follows as space BF: Fix for filterpoll incorrectly checking for jailless state ENH: strengthen detection of working pyinotify ENH: use the same python executable for setup.py test ENH: actually tune up TraceBack to determine "unittest" portions of the stack across all python releases TST: Some primarily smoke tests for tests utils TST: cover few more lines in fail2banreader.py ENH: basic test for setup.py itself (when applicable, should greatly improve coverage ;) ) ENH: consistent operation of formatExceptionInfo + unittest for it ENH: point to the status of master branch on travis Conflicts: ChangeLog MANIFEST README.md fail2ban/version.py -- all of the above obvious version changes below files primarily needed just a bit of help in resolution config/jail.conf fail2ban/server/filterpoll.py fail2ban/server/server.py fail2ban/tests/servertestcase.py and following were more difficult -- git wasn't able to track renames/moves of the code fail2ban-testcases -- needed to introduce those changes to tests/utils.py testcases/clientreadertestcase.py -- manually applied patch from master testcases/utils.py -- manually applied patch from master
Diffstat (limited to 'fail2ban/helpers.py')
-rw-r--r--fail2ban/helpers.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/fail2ban/helpers.py b/fail2ban/helpers.py
index dba4c9d6..c0cf052e 100644
--- a/fail2ban/helpers.py
+++ b/fail2ban/helpers.py
@@ -17,11 +17,7 @@
# along with Fail2Ban; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-# Author: Cyril Jaquier
-# Author: Arturo 'Buanzo' Busleiman
-#
-
-__author__ = "Cyril Jaquier"
+__author__ = "Cyril Jaquier, Arturo 'Buanzo' Busleiman"
__copyright__ = "Copyright (c) 2009 Cyril Jaquier"
__license__ = "GPL"
@@ -33,6 +29,12 @@ def formatExceptionInfo():
excName = cla.__name__
try:
excArgs = exc.__dict__["args"]
+ # Assure that we always return a string, without unneeded
+ # 'decorations' with python <= 2.5 where args would be a tuple
+ if isinstance(excArgs, tuple) and len(excArgs) == 1:
+ excArgs = excArgs[0]
+ excArgs = str(excArgs)
except KeyError:
+ # And always provide a string output
excArgs = str(exc)
return (excName, excArgs)