Module: check_mk
Branch: master
Commit: d6c98a0b6de01b541eccbab56bce47a22f65db36
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d6c98a0b6de01b…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Apr 17 13:46:42 2018 +0200
6009 FIX Rewrite event text in cancel events, too
Previously, only non-cancelling events had their text rewritten. This has
been fixed.
Change-Id: I513239d77e4ed8b51d8963f334dfa5feeaa0c0fc
---
.werks/6009 | 11 +++++++++++
cmk/ec/main.py | 4 ++++
2 files changed, 15 insertions(+)
diff --git a/.werks/6009 b/.werks/6009
new file mode 100644
index 0000000..16e217a
--- /dev/null
+++ b/.werks/6009
@@ -0,0 +1,11 @@
+Title: Rewrite event text in cancel events, too
+Level: 1
+Component: ec
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1523965551
+Class: fix
+
+Previously, only non-cancelling events had their text rewritten. This has
+been fixed.
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index 0b4e0a1..86e34b5 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -4186,8 +4186,12 @@ class EventStatus(object):
# values and the logfile entry if more relevant.
previous_phase = event["phase"]
event["phase"] = "closed"
+ # TODO: Why do we use OK below and not
new_event["state"]???
event["state"] = 0 # OK
event["text"] = new_event["text"]
+ # TODO: This is a hack and partial copy-n-paste from
rewrite_events...
+ if "set_text" in rule:
+ event["text"] =
replace_groups(rule["set_text"], event["text"], match_groups)
event["time"] = new_event["time"]
event["last"] = new_event["time"]
event["priority"] = new_event["priority"]