From 004c5fa805bfb982f55de533bc109fa21bacfbc8 Mon Sep 17 00:00:00 2001 From: Julius Unverfehrt Date: Tue, 22 Mar 2022 15:38:15 +0100 Subject: [PATCH] Adjust error handling for missing prometheus endpoint: error is logged not raised --- pyinfra/config.py | 15 +++++++-------- pyinfra/flask.py | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/pyinfra/config.py b/pyinfra/config.py index 5927171..937b760 100644 --- a/pyinfra/config.py +++ b/pyinfra/config.py @@ -7,14 +7,13 @@ from pyinfra.locations import CONFIG_FILE def make_art(): return """ -______ _____ __ -| ___ \ |_ _| / _| -| |_/ / _ | | _ __ | |_ _ __ __ _ -| __/ | | || || '_ \| _| '__/ _` | -| | | |_| || || | | | | | | | (_| | -\_| \__, \___/_| |_|_| |_| \__,_| - __/ | - |___/ + ___ _ _ ___ __ + o O O | _ \ | || | |_ _| _ _ / _| _ _ __ _ + o | _/ \_, | | | | ' \ | _| | '_| / _` | + TS__[O] _|_|_ _|__/ |___| |_||_| _|_|_ _|_|_ \__,_| + {======|_| ``` |_| ````|_|`````|_|`````|_|`````|_|`````|_|`````| +./o--000' `-0-0-' `-0-0-' `-0-0-' `-0-0-' `-0-0-' `-0-0-' `-0-0-' + """ diff --git a/pyinfra/flask.py b/pyinfra/flask.py index fcddb97..549ef0c 100644 --- a/pyinfra/flask.py +++ b/pyinfra/flask.py @@ -58,7 +58,7 @@ def set_up_probing_webserver(): logger.warning(f"Got no metrics from analysis prometheus endpoint: {err}") informed_about_missing_prometheus_endpoint = True else: - raise err + logging.warning(f"Caught {err}") return resp.text return app