From be945bc9e76d97e513319a00b6e8813d77b05543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 14 Aug 2021 20:44:14 +0200 Subject: [PATCH] prometheus: don't run exim tests if exim is not installed (#56145) --- prometheus-entrouvert-exporter/prometheus-system-exporter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/prometheus-entrouvert-exporter/prometheus-system-exporter.py b/prometheus-entrouvert-exporter/prometheus-system-exporter.py index a5a282f..4498481 100755 --- a/prometheus-entrouvert-exporter/prometheus-system-exporter.py +++ b/prometheus-entrouvert-exporter/prometheus-system-exporter.py @@ -74,6 +74,8 @@ def etckeeper(ctn): def exim(ctn): + if not os.path.exists('/usr/sbin/exim'): + return with open('/var/log/exim4/mainlog', 'rb') as fh: for line in fh.readlines(): if b" ** " in line and not (