|
|
@ -145,7 +145,7 @@ class Fail2banClient:
|
|
|
|
|
|
|
|
|
|
|
|
def __processCmd(self, cmd, showRet = True):
|
|
|
|
def __processCmd(self, cmd, showRet = True):
|
|
|
|
beautifier = Beautifier()
|
|
|
|
beautifier = Beautifier()
|
|
|
|
ret = True
|
|
|
|
streamRet = True
|
|
|
|
for c in cmd:
|
|
|
|
for c in cmd:
|
|
|
|
beautifier.setInputCmd(c)
|
|
|
|
beautifier.setInputCmd(c)
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -159,7 +159,7 @@ class Fail2banClient:
|
|
|
|
logSys.error("NOK: " + `ret[1].args`)
|
|
|
|
logSys.error("NOK: " + `ret[1].args`)
|
|
|
|
if showRet:
|
|
|
|
if showRet:
|
|
|
|
print beautifier.beautifyError(ret[1])
|
|
|
|
print beautifier.beautifyError(ret[1])
|
|
|
|
ret = False
|
|
|
|
streamRet = False
|
|
|
|
except socket.error:
|
|
|
|
except socket.error:
|
|
|
|
if showRet:
|
|
|
|
if showRet:
|
|
|
|
logSys.error("Unable to contact server. Is it running?")
|
|
|
|
logSys.error("Unable to contact server. Is it running?")
|
|
|
@ -168,7 +168,7 @@ class Fail2banClient:
|
|
|
|
if showRet:
|
|
|
|
if showRet:
|
|
|
|
logSys.error(e)
|
|
|
|
logSys.error(e)
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
return ret
|
|
|
|
return streamRet
|
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
##
|
|
|
|
# Process a command line.
|
|
|
|
# Process a command line.
|
|
|
|