Module: check_mk
Branch: master
Commit: 48b6e853ffede5208f5a4e9ab3c06cae96083ac1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=48b6e853ffede5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Oct 16 16:34:04 2018 +0200
6785 FIX Fixed truncating leading new lines in text area input fields
When a multi line text area was used for editing a text that starts with an
empty line, the leading empty line was stripped off during rendering of the
dialog.
This affected, for example, the body template of ASCII mail notifications.
CMK-930
Change-Id: I11a991a298629731cbb584f2169a0b96556ebe93
---
.werks/6785 | 15 +++++++++++++++
cmk/gui/htmllib.py | 13 +++++++++++++
2 files changed, 28 insertions(+)
diff --git a/.werks/6785 b/.werks/6785
new file mode 100644
index 0000000..1cb01de
--- /dev/null
+++ b/.werks/6785
@@ -0,0 +1,15 @@
+Title: Fixed truncating leading new lines in text area input fields
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1539700301
+
+When a multi line text area was used for editing a text that starts with an
+empty line, the leading empty line was stripped off during rendering of the
+dialog.
+
+This affected, for example, the body template of ASCII mail notifications.
diff --git a/cmk/gui/htmllib.py b/cmk/gui/htmllib.py
index 17fc4e5..ddc9f59 100644
--- a/cmk/gui/htmllib.py
+++ b/cmk/gui/htmllib.py
@@ -2420,6 +2420,19 @@ class html(HTMLGenerator):
attrs["cols"] = cols
attrs["name"] = varname
+ # Fix handling of leading newlines (https://www.w3.org/TR/html5/syntax.html#element-restrictions)
+ #
+ # """
+ # A single newline may be placed immediately after the start tag of pre
+ # and textarea elements. This does not affect the processing of the
+ # element. The otherwise optional newline must be included if the
+ # element’s contents themselves start with a newline (because otherwise
+ # the leading newline in the contents would be treated like the
+ # optional newline, and ignored).
+ # """
+ if value and value.startswith("\n"):
+ value = "\n" + value
+
if error:
self.open_x(class_="inputerror")
self.write_html(self._render_content_tag("textarea", value, **attrs))
Module: check_mk
Branch: master
Commit: 26678569925e26edcd3d9abb4e2d9028822548f4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=26678569925e26…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Oct 16 16:24:22 2018 +0200
Status data inventory is ignored for Check_MK clusters
Change-Id: Ib351b9a639c49d04e4beb1f701ac21d4628c38f1
---
.werks/6736 | 16 ++++++++++++++++
cmk_base/inventory.py | 5 ++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/.werks/6736 b/.werks/6736
new file mode 100644
index 0000000..6d2493c
--- /dev/null
+++ b/.werks/6736
@@ -0,0 +1,16 @@
+Title: Status data inventory is ignored for Check_MK clusters
+Level: 1
+Component: inv
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1538487393
+
+Status data inventory is not executed for Check_MK clusters
+because they do not have own data sources for which status data
+inventory is reasonable.
+If status data inventory should be done for the related nodes
+then you enable {{Status data inventory}} wihtin the ruleset
+{{Do hardware/software Inventory}} for these nodes.
diff --git a/cmk_base/inventory.py b/cmk_base/inventory.py
index 1a70030..3ffdaca 100644
--- a/cmk_base/inventory.py
+++ b/cmk_base/inventory.py
@@ -152,8 +152,10 @@ def do_inv_check(hostname, options):
def do_status_data_inventory(sources, multi_host_sections, hostname, ipaddress):
- import cmk_base.inventory_plugins as inventory_plugins
+ if config.is_cluster(hostname):
+ return
# cmk_base/modes/check_mk.py loads check plugins but not inventory plugins
+ import cmk_base.inventory_plugins as inventory_plugins
do_inv = False
section_names = multi_host_sections.get_host_sections().get((hostname, ipaddress)).sections.keys()
inventory_plugins.load_plugins(check_api.get_check_api_context, get_inventory_context)
@@ -337,6 +339,7 @@ def _save_inventory_tree(hostname, inventory_tree):
filepath = _inventory_output_dir + "/" + hostname
if inventory_tree:
old_tree = StructuredDataTree().load_from(filepath)
+ old_tree.normalize_nodes()
if old_tree.is_equal(inventory_tree):
console.verbose("Inventory was unchanged\n")
else: