]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/alerts: fix module fails to start without smtp_host 32316/head
authorKiefer Chang <kiefer.chang@suse.com>
Thu, 19 Dec 2019 01:21:04 +0000 (09:21 +0800)
committerKiefer Chang <kiefer.chang@suse.com>
Thu, 19 Dec 2019 01:25:08 +0000 (09:25 +0800)
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>
src/pybind/mgr/alerts/module.py

index d3098e1a3ef9d2d38698403e9ae6bf8a90946344..fcd71e55606c78b4009f10988a01d37456099d20 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):