]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/alerts: fix module fails to start without smtp_host 36104/head
authorKiefer Chang <kiefer.chang@suse.com>
Thu, 19 Dec 2019 01:21:04 +0000 (09:21 +0800)
committerNeha Ojha <nojha@redhat.com>
Tue, 14 Jul 2020 23:02:17 +0000 (23:02 +0000)
The option setting loop in config_notify raises an exception if
smtp_host option is not configured.

Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
(cherry picked from commit b6b6f046b8af1589816b7bff33b2642ab331824e)

src/pybind/mgr/alerts/module.py

index 0cb9e6740b31f4838361b3f5898ba0f80188290b..d6cec4b64baccd56727f2179094ea7c65adedd2b 100644 (file)
@@ -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):