subfolders now take precedence
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 4b771d9610a69f4bcd5d9e285ff633496a66ce8c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4b771d9610a69f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jun 7 11:37:29 2012 +0200
FIX: fix order of rule execution: subfolders now take precedence
---
ChangeLog | 4 ++++
web/htdocs/wato.py | 7 ++++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ddbf849..03d0f44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,10 @@
* FIX: fix severe exception in all views on older Python versions
(like RedHat 5.5).
+ WATO:
+ * FIX: fix order of rule execution: subfolders now take precedence
+ as they should.
+
1.2.0:
Setup:
* FIX: fix building of RPM packages (due to mk_mysql, mk_postgres)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index b30eea3..15c7162 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -10203,15 +10203,16 @@ def save_rulesets(folder, rulesets):
if ':' in varname:
dictname, subkey = varname.split(':')
+ varname = '%s[%r]' % (dictname, subkey)
out.write("\n%s.setdefault(%r, [])\n" % (dictname, subkey))
- out.write("%s[%r] += [\n" % (dictname, subkey))
else:
if rulespec["optional"]:
out.write("\nif %s == None:\n %s = []\n" % (varname,
varname))
- out.write("\n%s += [\n" % varname)
+
+ out.write("\n%s = [\n" % varname)
for rule in ruleset:
save_rule(out, folder, rulespec, rule)
- out.write("]\n\n")
+ out.write("] + %s\n\n" % varname)
def save_rule(out, folder, rulespec, rule):
out.write(" ( ")