Module: check_mk
Branch: master
Commit: 07de01ba2fd0de9ad62d44f8e3802067df245762
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=07de01ba2fd0de…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 17 12:11:11 2013 +0100
FIX: Rulesets are always cloned in the same folder
---
ChangeLog | 1 +
web/htdocs/wato.py | 17 +++++------------
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 40ed03c..b00924e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,7 @@
* CPU load ruleset does now accept float values
* Added valuespec for cisco_mem check to configure thresholds via WATO
* FIX: Fixed displaying of tag selections when creating a rule in the ruleeditor
+ * FIX: Rulesets are always cloned in the same folder
1.2.1i4:
Core:
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index a6725a1..45968b7 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9767,16 +9767,9 @@ def mode_edit_ruleset(phase):
elif action == "insert":
if not html.check_transaction():
return None # browser reload
- if g_folder == rule_folder:
- rules[rulenr:rulenr] = [rules[rulenr]]
- save_rulesets(rule_folder, rulesets)
- mark_affected_sites_dirty(rule_folder)
- else:
- folder_rulesets = load_rulesets(g_folder)
- folder_rules = folder_rulesets.setdefault(varname, [])
- folder_rules.append(rules[rulenr])
- save_rulesets(g_folder, folder_rulesets)
- mark_affected_sites_dirty(g_folder)
+ rules[rulenr:rulenr] = [rules[rulenr]]
+ save_rulesets(rule_folder, rulesets)
+ mark_affected_sites_dirty(rule_folder)
log_pending(AFFECTED, None, "edit-ruleset",
_("Inserted new rule in ruleset %s") %
rulespec["title"])
@@ -9912,8 +9905,8 @@ def mode_edit_ruleset(phase):
("item", mk_repr(item)),
("rule_folder", folder[".path"])])
html.icon_button(edit_url, _("Edit this rule"), "edit")
- rule_button("insert", _("Insert a copy of this rule into the
folder '%s'")
- % g_folder["title"], folder, rel_rulenr)
+ rule_button("insert", _("Insert a copy of this rule in current
folder"),
+ folder, rel_rulenr)
rule_button("delete", _("Delete this rule"), folder,
rel_rulenr)