Module: check_mk
Branch: master
Commit: ee96526834dacc9f3d291c1ac8c57a5bf4b19deb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ee96526834dacc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 20 14:09:01 2015 +0100
#2010 FIX Improved error message when trying to add group assignment rule without having a group configured
---
.werks/2010 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/valuespec.py | 6 +++---
web/htdocs/wato.py | 3 +++
4 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/.werks/2010 b/.werks/2010
new file mode 100644
index 0000000..6e638e9
--- /dev/null
+++ b/.werks/2010
@@ -0,0 +1,9 @@
+Title: Improved error message when trying to add group assignment rule without having a group configured
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.7i1
+Date: 1424437663
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 92e3c3c..3b69866 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -243,6 +243,7 @@
* 1987 FIX: Editing auxtags shows existing topics in dropdown instead of as "create new topic"
* 2001 FIX: Fix exception of missing .site when editing a non-existing host
* 2009 FIX: Fixed styling of site login page for establishing a distributed monitoring WATO sync...
+ * 2010 FIX: Improved error message when trying to add group assignment rule without having a group configured
Notifications:
* 1662 notification plugin spectrum: finalized script. now able to handle host notications
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index f486bc2..14200ff 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -2930,6 +2930,7 @@ class ElementSelection(ValueSpec):
ValueSpec.__init__(self, **kwargs)
self._loaded_at = None
self._label = kwargs.get("label")
+ self._empty_text = kwargs.get("empty_text", _("There are not defined any elements for this selection yet."))
def load_elements(self):
if self._loaded_at != id(html):
@@ -2944,7 +2945,7 @@ class ElementSelection(ValueSpec):
def render_input(self, varprefix, value):
self.load_elements()
if len(self._elements) == 0:
- html.write(_("There are not defined any elements for this selection yet."))
+ html.write(self._empty_text)
else:
if self._label:
html.write("%s " % self._label)
@@ -2960,8 +2961,7 @@ class ElementSelection(ValueSpec):
def validate_value(self, value, varprefix):
self.load_elements()
if len(self._elements) == 0:
- raise MKUserError(varprefix,
- _("You cannot save this rule. There are not defined any elements for this selection yet."))
+ raise MKUserError(varprefix, _("You cannot save this rule.") + ' ' + self._empty_text)
if value not in self._elements:
raise MKUserError(varprefix, _("%s is not an existing element in this selection.") % (value,))
ValueSpec.custom_validate(self, value, varprefix)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 6a8ee20..ace5385 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -8112,6 +8112,9 @@ def save_group_information(all_groups):
class GroupSelection(ElementSelection):
def __init__(self, what, **kwargs):
+ kwargs.setdefault('empty_text', _('You have not defined any %s group yet. Please '
+ '<a href="wato.py?mode=edit_%s_group">create</a> at least one first.') %
+ (what, what))
ElementSelection.__init__(self, **kwargs)
self._what = what
# Allow to have "none" entry with the following title
Module: check_mk
Branch: master
Commit: 12b501436af4bec224ca53d6605c99a14e41d4f2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=12b501436af4be…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Feb 20 14:04:02 2015 +0100
#2006 FIX services: Add WATO rule for configuring parameters of discovered checks
Up to now you could only select under which conditions a Windows service would
be discovered - but later it would be checked for <tt>running</tt> / <tt>auto</tt>.
Now you can select the target state via a new WATO rule set <i>Windows Services</i>.
---
.werks/2006 | 12 ++++++++++++
ChangeLog | 1 +
2 files changed, 13 insertions(+)
diff --git a/.werks/2006 b/.werks/2006
new file mode 100644
index 0000000..cffbb17
--- /dev/null
+++ b/.werks/2006
@@ -0,0 +1,12 @@
+Title: services: Add WATO rule for configuring parameters of discovered checks
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1424437361
+
+Up to now you could only select under which conditions a Windows service would
+be discovered - but later it would be checked for <tt>running</tt> / <tt>auto</tt>.
+Now you can select the target state via a new WATO rule set <i>Windows Services</i>.
diff --git a/ChangeLog b/ChangeLog
index 0daf842..31068ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -171,6 +171,7 @@
NOTE: Please refer to the migration notes!
* 2000 FIX: check_mk_agent.freebsd: Add missing <<<local>>> section, plugins was twice instead...
* 2004 FIX: windows_updates: fix exception in WATO when displaying default levels
+ * 2006 FIX: services: Add WATO rule for configuring parameters of discovered checks...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...