Skip to content

Commit 9d8dbc9

Browse files
committed
Handle misconfigured Slack alerter
1 parent fcab830 commit 9d8dbc9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Alerters/slack.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
class SlackAlerter(Alerter):
1111
"""Send alerts to a Slack webhook."""
1212

13+
channel = None
14+
1315
def __init__(self, config_options):
1416
if not requests_available:
1517
print "Requests package is not available, cannot use SlackAlerter."
@@ -35,6 +37,9 @@ def __init__(self, config_options):
3537
def send_alert(self, name, monitor):
3638
"""Send the message."""
3739

40+
if self.channel is None:
41+
return
42+
3843
type = self.should_alert(monitor)
3944
(days, hours, minutes, seconds) = self.get_downtime(monitor)
4045

0 commit comments

Comments
 (0)