Fixed bug that was introduced after adding new alert types

This is why I need integration tests...
This commit is contained in:
IamTheFij 2018-04-18 21:50:50 -07:00
parent 26b17a4019
commit 713abaa736

View File

@ -3,6 +3,7 @@ import subprocess
import sys import sys
from argparse import ArgumentParser from argparse import ArgumentParser
from datetime import datetime from datetime import datetime
from itertools import chain
from subprocess import CalledProcessError from subprocess import CalledProcessError
from subprocess import check_output from subprocess import check_output
from time import sleep from time import sleep
@ -292,7 +293,7 @@ class Minitor(object):
) )
) )
# Validate that the the alerts for the monitor exist # Validate that the the alerts for the monitor exist
for alert in monitor.alerts: for alert in chain(monitor.alert_down, monitor.alert_up):
if alert not in self.alerts: if alert not in self.alerts:
raise InvalidMonitorException( raise InvalidMonitorException(
'Monitor {} contains an unknown alert: {}'.format( 'Monitor {} contains an unknown alert: {}'.format(