Module: check_mk
Branch: master
Commit: dc4740dd361cd407b28d24838ae2c28408716a42
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dc4740dd361cd4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 3 11:40:14 2016 +0100
#3231 FIX Not showing network scan properties in host search form anymore
---
.werks/3231 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 2 ++
web/htdocs/watolib.py | 22 ++++++++++++++--------
web/plugins/wato/builtin_attributes.py | 2 ++
5 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/.werks/3231 b/.werks/3231
new file mode 100644
index 0000000..1dec013
--- /dev/null
+++ b/.werks/3231
@@ -0,0 +1,10 @@
+Title: Not showing network scan properties in host search form anymore
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1457001592
+
+
diff --git a/ChangeLog b/ChangeLog
index f6c36ce..859415b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -83,6 +83,7 @@
* 2998 FIX: Fixed broken WATO rules where content is dynamically loaded...
* 3246 FIX: Fix link for editing a BI aggregation after coming back from the details
of another aggregation...
* 3000 FIX: Host check command: "Use a custom check plugin" was not working
with CMC...
+ * 3231 FIX: Not showing network scan properties in host search form anymore
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 4117126..e590b5f 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -15457,6 +15457,8 @@ def configure_attributes(new, hosts, for_what, parent,
myself=None, without_attr
return True
elif for_what == "folder" and not attr.show_in_folder():
return True
+ elif for_what == "host_search" and not attr.show_in_host_search():
+ return True
return False
# The remaining topics are shown in the order of the
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 27b3ebdc6..c8373ff 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -2218,6 +2218,11 @@ class Attribute:
def show_in_folder(self):
return self._show_in_folder
+ # Wether or not to make this attribute configurable in
+ # the host search form
+ def show_in_host_search(self):
+ return self._show_in_host_search
+
# Wether or not this attribute can be edited after creation
# of the object
def editable(self):
@@ -2668,19 +2673,20 @@ g_host_attributes = []
g_host_attribute = {}
# Declare attributes with this method
-def declare_host_attribute(a, show_in_table = True, show_in_folder = True,
+def declare_host_attribute(a, show_in_table = True, show_in_folder = True,
show_in_host_search = True,
topic = None, show_in_form = True, depends_on_tags = [], depends_on_roles = [],
editable = True,
show_inherited_value = True, may_edit = None):
g_host_attributes.append((a, topic))
g_host_attribute[a.name()] = a
- a._show_in_table = show_in_table
- a._show_in_folder = show_in_folder
- a._show_in_form = show_in_form
- a._show_inherited_value = show_inherited_value
- a._depends_on_tags = depends_on_tags
- a._depends_on_roles = depends_on_roles
- a._editable = editable
+ a._show_in_table = show_in_table
+ a._show_in_folder = show_in_folder
+ a._show_in_host_search = show_in_host_search
+ a._show_in_form = show_in_form
+ a._show_inherited_value = show_inherited_value
+ a._depends_on_tags = depends_on_tags
+ a._depends_on_roles = depends_on_roles
+ a._editable = editable
if may_edit:
a.may_edit = may_edit
diff --git a/web/plugins/wato/builtin_attributes.py
b/web/plugins/wato/builtin_attributes.py
index 7c62661..75f2100 100644
--- a/web/plugins/wato/builtin_attributes.py
+++ b/web/plugins/wato/builtin_attributes.py
@@ -231,6 +231,7 @@ declare_host_attribute(NetworkScanAttribute(),
show_in_table = False,
show_in_form = False,
show_in_folder = True,
+ show_in_host_search = False,
show_inherited_value = False,
may_edit = lambda: config.may("wato.manage_hosts"),
topic = _("Network Scan"))
@@ -296,6 +297,7 @@ declare_host_attribute(NetworkScanResultAttribute(),
show_in_table = False,
show_in_form = False,
show_in_folder = True,
+ show_in_host_search = False,
show_inherited_value = False,
editable = False,
topic = _("Network Scan"))