From: Kiefer Chang Date: Thu, 19 Dec 2019 01:21:04 +0000 (+0800) Subject: mgr/alerts: fix module fails to start without smtp_host X-Git-Tag: v14.2.11~52^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0a5a4b2319cbd80431676d896914dcd9898973d0;p=ceph.git 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) --- 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):