Module: check_mk
Branch: master
Commit: 1cf0c2ba90d1af4e1e03b90ea9b24602fece386d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1cf0c2ba90d1af…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jan 9 11:37:31 2017 +0100
4226 FIX Custom inventory painters are now correctly loaded when declared with
inventory_displayhints
Change-Id: I440c7231d1f9d6c040a283d338cb3e11a527cc31
---
.werks/4226 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/views.py | 2 ++
web/plugins/views/inventory.py | 14 ++++++++------
4 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/.werks/4226 b/.werks/4226
new file mode 100644
index 0000000..a69475b
--- /dev/null
+++ b/.werks/4226
@@ -0,0 +1,10 @@
+Title: Custom inventory painters are now correctly loaded when declared with
inventory_displayhints
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i4
+Date: 1483958171
+
+
diff --git a/ChangeLog b/ChangeLog
index 9d7b702..24d2ca0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,6 +34,7 @@
* 4144 FIX: Sidebar: Bottom of last snapin was not 100% visible
* 4145 FIX: Fixed exception when setting output_format in wrong case
* 4220 FIX: WATO folder filter: improve output of unknown folders
+ * 4226 FIX: Custom inventory painters are now correctly loaded when declared with
inventory_displayhints
WATO:
* 4142 New extended search dialog for rulesets and rules...
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 148d3b3..10501ea 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -80,6 +80,8 @@ def load_plugins(force):
# Make sure that custom views also have permissions
config.declare_dynamic_permissions(lambda:
visuals.declare_custom_permissions('views'))
+ declare_inventory_columns()
+
# Load all views - users or builtins
def load_views():
diff --git a/web/plugins/views/inventory.py b/web/plugins/views/inventory.py
index eab83ca..04eb056 100644
--- a/web/plugins/views/inventory.py
+++ b/web/plugins/views/inventory.py
@@ -844,12 +844,14 @@ inventory_displayhints.update({
".networking.wlan.controller.accesspoints:*.sys_location" : {
"title" : _("System Location") },
})
-# create painters for node with a display hint
-for invpath, hint in inventory_displayhints.items():
- if "*" not in invpath:
- datatype = hint.get("paint", "str")
- long_title = inv_titleinfo_long(invpath, None)
- declare_inv_column(invpath, datatype, long_title, hint.get("short",
hint["title"]))
+
+def declare_inventory_columns():
+ # create painters for node with a display hint
+ for invpath, hint in inventory_displayhints.items():
+ if "*" not in invpath:
+ datatype = hint.get("paint", "str")
+ long_title = inv_titleinfo_long(invpath, None)
+ declare_inv_column(invpath, datatype, long_title, hint.get("short",
hint["title"]))
#.