summaryrefslogtreecommitdiff
path: root/fail2ban/helpers.py
diff options
context:
space:
mode:
authorDaniel Black <grooverdan@users.sourceforge.net>2013-11-02 15:59:05 +1100
committerDaniel Black <grooverdan@users.sourceforge.net>2013-11-02 15:59:05 +1100
commit47d35c9d808c18e92ea2c245522826c9ece8e144 (patch)
treeb70a02a57e944df297d335c38ab4aa23f37deb5f /fail2ban/helpers.py
parent5a2623f0dfc1c7ae607b41bb7a71c8545321b34a (diff)
parenta9fe3d5df90dffa600324eba0e3a1915ad28666e (diff)
downloadfail2ban-47d35c9d808c18e92ea2c245522826c9ece8e144.tar.gz
MRG: 0.8.11 to 0.9
Epnoc of selinux is now true UTC Merge multiline support and date detection in filter
Diffstat (limited to 'fail2ban/helpers.py')
-rw-r--r--fail2ban/helpers.py18
1 files changed, 3 insertions, 15 deletions
diff --git a/fail2ban/helpers.py b/fail2ban/helpers.py
index c0cf052e..74ea7a7a 100644
--- a/fail2ban/helpers.py
+++ b/fail2ban/helpers.py
@@ -17,24 +17,12 @@
# 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, Arturo 'Buanzo' Busleiman"
-__copyright__ = "Copyright (c) 2009 Cyril Jaquier"
+__author__ = "Cyril Jaquier, Arturo 'Buanzo' Busleiman, Yaroslav Halchenko"
__license__ = "GPL"
def formatExceptionInfo():
- """ Author: Arturo 'Buanzo' Busleiman """
+ """ Consistently format exception information """
import sys
cla, exc = sys.exc_info()[:2]
- 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)
+ return (cla.__name__, str(exc))