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

pull/1484/head
sebres 2016-07-14 11:35:32 +02:00
parent 683f8fc56c
commit 41e3f2e5ed
1 changed files with 4 additions and 0 deletions

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)