Module: check_mk
Branch: master
Commit: 85dd6b27269fc283103fd1584b3d1daab7869521
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=85dd6b27269fc2…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Sep 14 10:46:26 2018 +0200
6503 FIX Fixed error handling for duplicate EC rule IDs.
Trying to insert an EC rule with an already existing ID resulted in a GUI
crash, this has been fixed.
Change-Id: If38a8c3067f003b212d403eb061af898c81951e6
---
.werks/6503 | 12 ++++++++++++
cmk/gui/wato/mkeventd.py | 4 ++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/6503 b/.werks/6503
new file mode 100644
index 0000000..993308d
--- /dev/null
+++ b/.werks/6503
@@ -0,0 +1,12 @@
+Title: Fixed error handling for duplicate EC rule IDs.
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1536843614
+
+Trying to insert an EC rule with an already existing ID resulted in a GUI
+crash, this has been fixed.
diff --git a/cmk/gui/wato/mkeventd.py b/cmk/gui/wato/mkeventd.py
index 521890b..84ff85d 100644
--- a/cmk/gui/wato/mkeventd.py
+++ b/cmk/gui/wato/mkeventd.py
@@ -1957,8 +1957,8 @@ class ModeEventConsoleEditRule(EventConsoleMode):
for pack in self._rule_packs:
for r in pack["rules"]:
if r["id"] == self._rule["id"]:
- error_text = _("A rule with this ID already exists in rule
pack <b>%s</b>.") % pack["title"]
- raise MKUserError("rule_p_id", error_text)
+ raise MKUserError("rule_p_id",
+ _("A rule with this ID already exists in
rule pack <b>%s</b>.") % pack["title"])
try:
num_groups = re.compile(self._rule["match"]).groups