Module: check_mk
Branch: master
Commit: c09723e9ef2a18cd2e4a2371e2cb223eebbdbf8d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c09723e9ef2a18…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Mar 26 10:23:41 2018 +0200
Centralized legacy rule conversion.
Change-Id: Ib8afa73c06cd27a7c3ca09d2627dc4433219e072
---
cmk/ec/export.py | 14 ++++++++------
cmk/ec/main.py | 9 ---------
2 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/cmk/ec/export.py b/cmk/ec/export.py
index a950fe6..bfb07b1 100644
--- a/cmk/ec/export.py
+++ b/cmk/ec/export.py
@@ -220,6 +220,14 @@ def load_config(settings):
if not isinstance(livetime, tuple):
rule["livetime"] = (livetime, ["open"])
+ # Convert legacy rules into a default rule pack. Note that we completely
+ # ignore legacy rules if there are rule packs alreday. It's a bit unclear
+ # if we really want that, but at least that's how it worked in the past...
+ if config["rules"] and not config["rule_packs"]:
+ config["rule_packs"] = [
+ cmk.ec.defaults.default_rule_pack(config["rules"])]
+ config["rules"] = []
+
return config
@@ -233,12 +241,6 @@ def load_rule_packs():
object.
"""
config = load_config(_default_settings())
-
- # Convert old plain rules into a list of one rule pack
- if config["rules"] and not config["rule_packs"]:
- config["rule_packs"] = [
- cmk.ec.defaults.default_rule_pack(config["rules"])]
-
return config['rules'], config['rule_packs']
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index 1034308..a29c754 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -2032,15 +2032,6 @@ class EventServer(ECServerThread):
else:
return val.lower()
- # Convert legacy_rules into rule_packs
- if not rule_packs:
- rule_packs = [{
- "id": "default",
- "title": "Default rule package",
- "rules": legacy_rules,
- "disabled": False,
- }]
-
# Loop through all rule packages and with through their rules
for rule_pack in rule_packs:
if rule_pack["disabled"]:
Module: check_mk
Branch: master
Commit: c09d54881968d7626ba7c91c90a697485aca93ad
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c09d54881968d7…
Author: Andreas Umbreit <au(a)mathias-kettner.de>
Date: Mon Mar 26 07:46:40 2018 +0200
CMK-416: Fix typo in agent bakery site selection
Change-Id: I132a596470844d6cbe56e214e132f19fe41dfa3f
---
web/htdocs/wato.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 64fcb56..556204c 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -8119,8 +8119,8 @@ def simple_host_rule_match_conditions():
( "match_site",
DualListChoice(
title = _("Match site"),
- help = _("This condition makes the rule match only notifications that have been "
- "created on the selected sites."),
+ help = _("This condition makes the rule match only hosts of "
+ "the selected sites."),
choices = config.site_attribute_choices,
),
),
Module: check_mk
Branch: master
Commit: a3308f8efe55c9f7f94a340ca7632a8517dcdb50
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a3308f8efe55c9…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Mar 26 10:14:31 2018 +0200
Centralized 'livetime' legacy value conversion.
Change-Id: Ifcb7aa22620e1c9cb421a0e311ea4bd37eb9bc27
---
cmk/ec/export.py | 15 ++++++++-------
cmk/ec/main.py | 7 -------
2 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/cmk/ec/export.py b/cmk/ec/export.py
index 76d566b..a950fe6 100644
--- a/cmk/ec/export.py
+++ b/cmk/ec/export.py
@@ -212,6 +212,14 @@ def load_config(settings):
exec(file_object, config) # pylint: disable=exec-used
config.pop("MkpRulePackProxy", None)
_bind_to_rule_pack_proxies(config['rule_packs'], config['mkp_rule_packs'])
+
+ # Convert livetime fields in rules into new format
+ for rule in config["rules"]:
+ if "livetime" in rule:
+ livetime = rule["livetime"]
+ if not isinstance(livetime, tuple):
+ rule["livetime"] = (livetime, ["open"])
+
return config
@@ -226,13 +234,6 @@ def load_rule_packs():
"""
config = load_config(_default_settings())
- # Convert some data fields into a new format
- for rule in config["rules"]:
- if "livetime" in rule:
- livetime = rule["livetime"]
- if not isinstance(livetime, tuple):
- rule["livetime"] = (livetime, ["open"])
-
# Convert old plain rules into a list of one rule pack
if config["rules"] and not config["rule_packs"]:
config["rule_packs"] = [
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index dfc0e90..1034308 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -2057,13 +2057,6 @@ class EventServer(ECServerThread):
# Store information about rule pack right within the rule. This is needed
# for debug output and also for skipping rule packs
rule["pack"] = rule_pack["id"]
-
- # Convert some data fields into newer format
- if "livetime" in rule:
- livetime = rule["livetime"]
- if type(livetime) != tuple:
- rule["livetime"] = (livetime, ["open"])
-
self._rules.append(rule)
self._rule_by_id[rule["id"]] = rule
try: