From b6b6f046b8af1589816b7bff33b2642ab331824e 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 --- 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 d3098e1a3ef9..fcd71e55606c 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.47.3