explicit flush stdout/stderr before exit, because of possible buffered output in python (echo or grep fail2ban-client --version can sometimes returns nothing)

This commit is contained in:
sebres 2016-07-14 11:35:32 +02:00
parent 683f8fc56c
commit 41e3f2e5ed

View file

@ -270,6 +270,10 @@ class Fail2banCmdLine():
@staticmethod
def exit(code=0):
logSys.debug("Exit with code %s", code)
# because of possible buffered output in python, we should flush it before exit:
sys.stdout.flush()
sys.stderr.flush()
# exit
Fail2banCmdLine._exit(code)