From 3781ff845ad8028500a4d93192f9d47a20335190 Mon Sep 17 00:00:00 2001 From: Steven Hiscocks Date: Sat, 29 Mar 2014 22:54:06 +0000 Subject: [PATCH] BF: Fix getting jail name from exceptions in beautifier for Python 3+ --- fail2ban/client/beautifier.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fail2ban/client/beautifier.py b/fail2ban/client/beautifier.py index 68816b06..25d73cb2 100644 --- a/fail2ban/client/beautifier.py +++ b/fail2ban/client/beautifier.py @@ -188,9 +188,9 @@ class Beautifier: logSys.debug("Beautify (error) " + `response` + " with " + `self.__inputCmd`) msg = response if isinstance(response, UnknownJailException): - msg = "Sorry but the jail '" + response[0] + "' does not exist" + msg = "Sorry but the jail '" + response.args[0] + "' does not exist" elif isinstance(response, IndexError): msg = "Sorry but the command is invalid" elif isinstance(response, DuplicateJailException): - msg = "The jail '" + response[0] + "' already exists" + msg = "The jail '" + response.args[0] + "' already exists" return msg