fix: only overwrite severity for alarm being raised not cleared
ZeroDownTime/sns-alert-hub/pipeline/head This commit looks good Details

This commit is contained in:
Stefan Reimer 2022-02-24 12:34:12 +01:00
parent a45848733e
commit 9e7298478d
1 changed files with 3 additions and 2 deletions

5
app.py
View File

@ -125,8 +125,9 @@ def handler(event, context):
msg_type = notify_map[msg["NewStateValue"].lower()]
# Reduce severtity for CPUCredit Alarms to Warning
if msg["Trigger"]["MetricName"] == "CPUSurplusCreditBalance":
msg_type = apprise.NotifyType.WARNING
if msg_type == apprise.NotifyType.FAILURE:
if msg["Trigger"]["MetricName"] == "CPUSurplusCreditBalance":
msg_type = apprise.NotifyType.WARNING
except KeyError:
pass