From 0a5a4b2319cbd80431676d896914dcd9898973d0 Mon Sep 17 00:00:00 2001 From: Kiefer Chang Date: Thu, 19 Dec 2019 09:21:04 +0800 Subject: [PATCH] mgr/alerts: fix module fails to start without smtp_host The option setting loop in config_notify raises an exception if smtp_host option is not configured. Signed-off-by: Kiefer Chang (cherry picked from commit b6b6f046b8af1589816b7bff33b2642ab331824e) --- src/pybind/mgr/alerts/module.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pybind/mgr/alerts/module.py b/src/pybind/mgr/alerts/module.py index 0cb9e6740b31f..d6cec4b64bacc 100644 --- a/src/pybind/mgr/alerts/module.py +++ b/src/pybind/mgr/alerts/module.py @@ -29,6 +29,7 @@ class Alerts(MgrModule): # smtp { 'name': 'smtp_host', + 'default': '', 'desc': 'SMTP server', 'runtime': True, }, @@ -155,6 +156,8 @@ class Alerts(MgrModule): if r: for code, alert in r.items(): checks[code] = alert + else: + self.log.warn('Alert is not sent because smtp_host is not configured') self.set_health_checks(checks) def serve(self): -- 2.39.5