Commit b9fb002e authored by Andrey Vertiprahov's avatar Andrey Vertiprahov
Browse files

Merge branch 'fix-avs-escalation-key-error' into 'master'

Check  TT on already_escalation method for fix Key Error when check notification doc.

See merge request !6248
parents 29fda0d4 e0d7d492
Pipeline #36053 passed with stages
in 51 minutes and 31 seconds
......@@ -377,7 +377,11 @@ class EscalationSequence(BaseSequence):
:returns: True if alarm is already escalated, False otherwise
"""
if not self.escalation_doc.leader.is_already_escalated:
if (
not self.escalation_doc.leader.is_already_escalated
or not self.escalation_doc.leader.current_tt_id
):
# not self.escalation_doc.leader.current_tt_id if notification doc
return False
tt = self.escalation_doc.leader.current_tt_id
self.log_alarm(f"Already escalated with TT #{tt}")
......@@ -642,7 +646,7 @@ class EscalationSequence(BaseSequence):
]
):
esc_status[doc["items"]["alarm"]] = doc["_id"]
esc_tt[doc["items"]["alarm"]] = doc["tt_id"]
esc_tt[doc["items"]["alarm"]] = doc.get("tt_id")
if not esc_status:
return # No escalated docs
for item in self.escalation_doc.items:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment