Module: check_mk
Branch: master
Commit: 554495b0e8bd4424980c91490ad2bc85e3cb5a91
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=554495b0e8bd44…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Apr 5 09:12:38 2018 +0200
5938 FIX Fixed search of event console packs and rules
Change-Id: Ic960b2215158bd1914d5e42d5246e6d52789469c
---
.werks/5938 | 10 ++++++++++
web/plugins/wato/mkeventd.py | 12 ++++++------
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/.werks/5938 b/.werks/5938
new file mode 100644
index 0000000..82c1476
--- /dev/null
+++ b/.werks/5938
@@ -0,0 +1,10 @@
+Title: Fixed search of event console packs and rules
+Level: 1
+Component: multisite
+Compatible: compat
+Edition: cre
+Version: 1.5.0i4
+Date: 1522912277
+Class: fix
+
+
diff --git a/web/plugins/wato/mkeventd.py b/web/plugins/wato/mkeventd.py
index c5e5b3b..b751c95 100644
--- a/web/plugins/wato/mkeventd.py
+++ b/web/plugins/wato/mkeventd.py
@@ -1351,12 +1351,12 @@ def rule_pack_with_id(rule_packs, rule_pack_id):
def filter_mkeventd_rule_packs(search_expression, rule_packs):
found_packs = {}
for rule_pack in rule_packs:
- if search_expression in rule_pack["id"] \
- or search_expression in rule_pack["title"]:
+ if search_expression in rule_pack["id"].lower() \
+ or search_expression in rule_pack["title"].lower():
found_packs.setdefault(rule_pack["id"], [])
for rule in rule_pack.get("rules", []):
- if search_expression in rule["id"] \
- or search_expression in rule.get("description"):
+ if search_expression in rule["id"].lower() \
+ or search_expression in rule.get("description").lower():
found_rules = found_packs.setdefault(rule_pack["id"], [])
found_rules.append(rule)
return found_packs
@@ -1617,8 +1617,8 @@ def copy_rules_from_master():
def filter_mkeventd_rules(search_expression, rule_pack):
found_rules = []
for rule in rule_pack.get("rules", []):
- if search_expression in rule["id"] \
- or search_expression in rule.get("description"):
+ if search_expression in rule["id"].lower() \
+ or search_expression in rule.get("description").lower():
found_rules.append(rule)
return found_rules