Module: check_mk
Branch: master
Commit: 8484cc34550c5187a94b16ac5d428463b72d3388
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8484cc34550c51…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 16 12:15:49 2013 +0100
FIX LDAP diagnostic LOG can now have the $OMD_SITE$ macro configured via WATO
The macro was configurable via plain config files for a long time, but it
could not be configured via WATO. This is now possible.
---
.werks/331 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/valuespec.py | 10 ++++++++++
web/plugins/wato/check_mk_configuration.py | 1 +
4 files changed, 23 insertions(+)
diff --git a/.werks/331 b/.werks/331
new file mode 100644
index 0000000..a6a1278
--- /dev/null
+++ b/.werks/331
@@ -0,0 +1,11 @@
+Title: LDAP diagnostic LOG can now have the $OMD_SITE$ macro configured via WATO
+Level: 1
+Component: wato
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387192477
+Targetversion: future
+
+The macro was configurable via plain config files for a long time, but it
+could not be configured via WATO. This is now possible.
diff --git a/ChangeLog b/ChangeLog
index 16082fb..7a17c48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -44,6 +44,7 @@
* 0309 FIX: Trying to prevent read/write conflicts with a large user base...
* 0311 FIX: Fixed "Inventory failed" message when trying an inventory on
clusters via WATO...
* 0330 FIX: Improved performance of WATO slave push with a large user base...
+ * 0331 FIX: LDAP diagnostic LOG can now have the $OMD_SITE$ macro configured via
WATO...
Notifications:
* 0108 FIX: Prevent service notification on host alerts...
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 08c7348..fa02b21 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -598,11 +598,21 @@ class Filename(TextAscii):
self._default_path = kwargs["default"]
else:
self._default_path = "/tmp/foo"
+ if "trans_func" in kwargs:
+ self._trans_func = kwargs["trans_func"]
+ else:
+ self._trans_func = None
def canonical_value(self):
return self._default_path
def validate_value(self, value, varprefix):
+ # The transformation function only changes the value for validation. This is
+ # usually a function which is later also used within the code which uses
+ # this variable to e.g. replace macros
+ if self._trans_func:
+ value = self._trans_func(value)
+
if len(value) == 0:
raise MKUserError(varprefix, _("Please enter a filename."))
diff --git a/web/plugins/wato/check_mk_configuration.py
b/web/plugins/wato/check_mk_configuration.py
index 60d64f0..2a25018 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -791,6 +791,7 @@ register_configvar(group,
Filename(
label = _("Absolute path to log file"),
default = defaults.var_dir + '/web/ldap-debug.log',
+ trans_func = userdb.ldap_replace_macros,
),
title = _("LDAP connection diagnostics"),
label = _("Activate logging of LDAP transactions into a logfile"),