Skip to content

Commit

Permalink
Fix alert list checking #9978
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Schaefer <[email protected]>
  • Loading branch information
schaefm-ibm committed Jun 26, 2024
1 parent 4821e84 commit f1e8482
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ocs_ci/utility/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ def check_alert_list(
it is not checked if there is more of occurences than one.
"""

target_alerts = [
all_alerts = [
alert for alert in alerts if alert.get("labels").get("alertname") == label
]
logger.info(f"Checking properties of found {label} alerts")

for key, state in enumerate(states):
target_alerts = [
alert
for alert in target_alerts
for alert in all_alerts
if alert["annotations"]["message"] == msg
and alert["annotations"]["severity_level"] == severity
and alert["state"] == state
Expand Down

0 comments on commit f1e8482

Please sign in to comment.