Module: check_mk
Branch: master
Commit: 5a701dcafc3bdbced99077ff2fe8c76f747a1909
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5a701dcafc3bdb…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Oct 10 13:06:55 2017 +0200
Fixed recently introduced issue with non working WATO rules
Change-Id: I460b6c60610d2259298da559a173ba2e06d125bb
---
.werks/5234 | 14 ++++++++++++++
cmk_base/caching.py | 16 +++++++++++++++-
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/.werks/5234 b/.werks/5234
new file mode 100644
index 0000000..5b8f81e
--- /dev/null
+++ b/.werks/5234
@@ -0,0 +1,14 @@
+Title: Fixed recently introduced issue with non working WATO rules
+Level: 2
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1507633099
+
+In 1.4.0p14 an internal caching mechanism was changed.
+This broke some caches and caused unexpected behaviours,
+because most configurable rules were considered as empty.
+
diff --git a/cmk_base/caching.py b/cmk_base/caching.py
index 28227b2..5de4ff7 100644
--- a/cmk_base/caching.py
+++ b/cmk_base/caching.py
@@ -94,6 +94,10 @@ class Cache(object):
self._populated = True
+ def set_not_populated(self):
+ self._populated = False
+
+
# Just a small wrapper round a dict to get some caching specific functionality
# for analysis etc.
@@ -129,10 +133,20 @@ class DictCache(dict, Cache):
}
+ def clear(self):
+ super(DictCache, self).clear()
+ self.set_not_populated()
+
+
+
class SetCache(set, Cache):
- pass
+ def clear(self):
+ super(SetCache, self).clear()
+ self.set_not_populated()
+
class ListCache(list, Cache):
def clear(self):
del self[:] # Clear the list in place
+ self.set_not_populated()