From 720e274c24e2a624a91bd9f0b708ca090378dd7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Tue, 31 Jul 2018 17:06:01 +0200 Subject: [PATCH] Ignore ps errors --- flask-monit/monitor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flask-monit/monitor.py b/flask-monit/monitor.py index c936aa6..4835c87 100644 --- a/flask-monit/monitor.py +++ b/flask-monit/monitor.py @@ -12,7 +12,7 @@ LOGGER_NAME = __name__ app = Flask(__name__) -@app.route('/', methods=['GET']) +@app.route('/health', methods=['GET']) def home_view(): # We check whether weechat is running url_regex = re.compile( @@ -30,8 +30,8 @@ def home_view(): for line in lines: if line.strip() == settings.PS_COMMAND: return 'OK\n', 200 - except subprocess.CalledProcessError as exn: - return 'Internal error: {}\n'.format(exn), 500 + except subprocess.CalledProcessError: + pass return 'Weechat not running\n', 406