diff --git a/fail2ban/client/beautifier.py b/fail2ban/client/beautifier.py index cbe4d327..742cbba6 100644 --- a/fail2ban/client/beautifier.py +++ b/fail2ban/client/beautifier.py @@ -34,18 +34,19 @@ logSys = getLogger(__name__) # converted into user readable messages. class Beautifier: - + def __init__(self, cmd = None): self.__inputCmd = cmd def setInputCmd(self, cmd): self.__inputCmd = cmd - + def getInputCmd(self): return self.__inputCmd - + def beautify(self, response): - logSys.debug("Beautify " + `response` + " with " + `self.__inputCmd`) + logSys.debug( + "Beautify " + repr(response) + " with " + repr(self.__inputCmd)) inC = self.__inputCmd msg = response try: @@ -102,7 +103,7 @@ class Beautifier: elif response == 4: msg = msg + "DEBUG" else: - msg = msg + `response` + msg = msg + repr(response) elif inC[1] == "dbfile": if response is None: msg = "Database currently disabled" @@ -183,13 +184,14 @@ class Beautifier: msg += ", ".join(response) except Exception: logSys.warning("Beautifier error. Please report the error") - logSys.error("Beautify " + `response` + " with " + `self.__inputCmd` + - " failed") - msg = msg + `response` + logSys.error("Beautify " + repr(response) + " with " + + repr(self.__inputCmd) + " failed") + msg = msg + repr(response) return msg def beautifyError(self, response): - logSys.debug("Beautify (error) " + `response` + " with " + `self.__inputCmd`) + logSys.debug("Beautify (error) " + repr(response) + " with " + + repr(self.__inputCmd)) msg = response if isinstance(response, UnknownJailException): msg = "Sorry but the jail '" + response.args[0] + "' does not exist" diff --git a/fail2ban/client/configreader.py b/fail2ban/client/configreader.py index 3f8abaf4..c0e13460 100644 --- a/fail2ban/client/configreader.py +++ b/fail2ban/client/configreader.py @@ -233,7 +233,7 @@ class ConfigReaderUnshared(SafeConfigParserWithIncludes): logSys.log(logLevel, "Non essential option '%s' not defined in '%s'.", option[1], sec) except ValueError: logSys.warning("Wrong value for '" + option[1] + "' in '" + sec + - "'. Using default one: '" + `option[2]` + "'") + "'. Using default one: '" + repr(option[2]) + "'") values[option[1]] = option[2] return values diff --git a/fail2ban/server/filtergamin.py b/fail2ban/server/filtergamin.py index ac1fdf27..e8473be4 100644 --- a/fail2ban/server/filtergamin.py +++ b/fail2ban/server/filtergamin.py @@ -63,7 +63,7 @@ class FilterGamin(FileFilter): def callback(self, path, event): - logSys.debug("Got event: " + `event` + " for " + path) + logSys.debug("Got event: " + repr(event) + " for " + path) if event in (gamin.GAMCreated, gamin.GAMChanged, gamin.GAMExists): logSys.debug("File changed: " + path) self.__modified = True diff --git a/fail2ban/server/transmitter.py b/fail2ban/server/transmitter.py index 5bf62128..565443d2 100644 --- a/fail2ban/server/transmitter.py +++ b/fail2ban/server/transmitter.py @@ -51,7 +51,7 @@ class Transmitter: def proceed(self, command): # Deserialize object - logSys.debug("Command: " + `command`) + logSys.debug("Command: " + repr(command)) try: ret = self.__commandHandler(command) ack = 0, ret