remove no more necessary PRODUCTION from fail2banclient.py

pull/1413/head
sebres 2016-07-13 09:54:54 +02:00
parent 53da35ea49
commit f0b2cd2e39
2 changed files with 6 additions and 10 deletions

View File

@ -35,7 +35,7 @@ from ..version import version
from .csocket import CSocket from .csocket import CSocket
from .beautifier import Beautifier from .beautifier import Beautifier
from .fail2bancmdline import Fail2banCmdLine, ServerExecutionException, ExitException, \ from .fail2bancmdline import Fail2banCmdLine, ServerExecutionException, ExitException, \
logSys, PRODUCTION, exit, output logSys, exit, output
PROMPT = "fail2ban> " PROMPT = "fail2ban> "
@ -361,19 +361,16 @@ class Fail2banClient(Fail2banCmdLine, Thread):
# Interactive mode # Interactive mode
if self._conf.get("interactive", False): if self._conf.get("interactive", False):
# no readline in test: try:
if PRODUCTION: # pragma: no cover import readline
try: except ImportError:
import readline raise ServerExecutionException("Readline not available")
except ImportError:
raise ServerExecutionException("Readline not available")
try: try:
ret = True ret = True
if len(args) > 0: if len(args) > 0:
ret = self.__processCommand(args) ret = self.__processCommand(args)
if ret: if ret:
if PRODUCTION: # pragma: no cover readline.parse_and_bind("tab: complete")
readline.parse_and_bind("tab: complete")
self.dispInteractive() self.dispInteractive()
while True: while True:
cmd = input_command() cmd = input_command()

View File

@ -107,7 +107,6 @@ fail2banclient.input_command = _test_input_command
# prevents change logging params, log capturing, etc: # prevents change logging params, log capturing, etc:
fail2bancmdline.PRODUCTION = \ fail2bancmdline.PRODUCTION = \
fail2banclient.PRODUCTION = \
fail2banserver.PRODUCTION = False fail2banserver.PRODUCTION = False