Module: check_mk
Branch: master
Commit: c12bfcb097a860a1994f7d2c67cebe0280b6ed52
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c12bfcb097a860…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 19 13:16:40 2016 +0100
Updated bug entries #0855
---
.bugs/855 | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/.bugs/855 b/.bugs/855
index c934747..f19f454 100644
--- a/.bugs/855
+++ b/.bugs/855
@@ -1,8 +1,11 @@
Title: PDF Export, Host down is red instead of blue in the timeline table
Component: multisite
-State: open
+Class: bug
+State: works4me
Date: 2015-10-29 09:18:23
Targetversion: 1.2.7
-Class: bug
Everywere the color for host down is a dark blue. Only in the PDF file, it's a red
+
+2016-01-19 13:16:39: changed state open -> works4me
+Seems this has been fixed. The color is OK in my tests.
Module: check_mk
Branch: master
Commit: 0dccf586af43aacae58ec662c009eb4746da9f73
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0dccf586af43aa…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 19 13:02:20 2016 +0100
#2925 FIX Editing a notification rule for a missing user selected random other user
This problem happened when a user was removed from the system but a
notification rule still referred to that user. You cannot save any changes
now unless you select another user or deselect the whole option now.
---
.bugs/2360 | 9 ++++++---
.bugs/848 | 7 +++++--
.werks/2925 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/valuespec.py | 32 +++++++++++++++++++++++---------
web/htdocs/wato.py | 1 +
6 files changed, 47 insertions(+), 14 deletions(-)
diff --git a/.bugs/2360 b/.bugs/2360
index 9078342..7ab250a 100644
--- a/.bugs/2360
+++ b/.bugs/2360
@@ -1,8 +1,11 @@
Title: "Fake check results" on hosts doesn't work
Component: multisite
-State: open
+Class: bug
+State: works4me
Date: 2015-08-31 16:26:06
Targetversion: 1.2.7
-Class: bug
-The "Fake check results" feature on hosts allows to set the status of the host to "up", "down" or "unreachable" but this has no effect, the host status stays as it was.
\ No newline at end of file
+The "Fake check results" feature on hosts allows to set the status of the host to "up", "down" or "unreachable" but this has no effect, the host status stays as it was.
+2016-01-19 12:39:14: changed state open -> works4me
+Works for me. Could be be cause of Smart PING that updates the
+state *really* fast.
diff --git a/.bugs/848 b/.bugs/848
index e1bb1c3..ae25f84 100644
--- a/.bugs/848
+++ b/.bugs/848
@@ -1,8 +1,11 @@
Title: RBN: Rules after user removal
Component: wato
-State: open
+Class: bug
+State: done
Date: 2015-05-13 14:56:09
Targetversion: 1.2.7
-Class: bug
After removing a user in wato and editing a rbn rule explicity containg this user, the next user from the list will choiced when saving
+
+2016-01-19 13:00:26: changed state open -> done
+The user is now forced to select a different user.
diff --git a/.werks/2925 b/.werks/2925
new file mode 100644
index 0000000..40af2f8
--- /dev/null
+++ b/.werks/2925
@@ -0,0 +1,11 @@
+Title: Editing a notification rule for a missing user selected random other user
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453204832
+Class: fix
+
+This problem happened when a user was removed from the system but a
+notification rule still referred to that user. You cannot save any changes
+now unless you select another user or deselect the whole option now.
diff --git a/ChangeLog b/ChangeLog
index 248f06a..d1341f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -249,6 +249,7 @@
* 2845 FIX: LDAP: Fixed exception in connection test on complain issue during connection creation
* 2779 FIX: Fix moving of folders...
* 2825 FIX: Parameter overview page no longer raises an exception in certain scenarios...
+ * 2925 FIX: Editing a notification rule for a missing user selected random other user...
Notifications:
* 2811 Mail notifications: Now able to add Host/Service Notes Url...
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 3e77416..c691b3c 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1225,14 +1225,14 @@ class Checkbox(ValueSpec):
class DropdownChoice(ValueSpec):
def __init__(self, **kwargs):
ValueSpec.__init__(self, **kwargs)
- self._choices = kwargs["choices"]
- self._help_separator = kwargs.get("help_separator")
- self._label = kwargs.get("label")
- self._prefix_values = kwargs.get("prefix_values", False)
- self._sorted = kwargs.get("sorted", False)
- self._empty_text = kwargs.get("empty_text", _("There are no elements defined for this selection yet."))
-
- self._no_preselect = kwargs.get("no_preselect", False)
+ self._choices = kwargs["choices"]
+ self._help_separator = kwargs.get("help_separator")
+ self._label = kwargs.get("label")
+ self._prefix_values = kwargs.get("prefix_values", False)
+ self._sorted = kwargs.get("sorted", False)
+ self._empty_text = kwargs.get("empty_text", _("There are no elements defined for this selection yet."))
+ self._invalid_choice = kwargs.get("invalid_choice", "replace") # also possible: "complain"
+ self._no_preselect = kwargs.get("no_preselect", False)
self._no_preselect_value = kwargs.get("no_preselect_value", None)
self._no_preselect_title = kwargs.get("no_preselect_title", "") # if not preselected
self._no_preselect_error = kwargs.get("no_preselect_error", _("Please make a selection"))
@@ -1268,6 +1268,11 @@ class DropdownChoice(ValueSpec):
options.append((str(n),) + entry[1:])
if entry[0] == value:
defval = str(n)
+
+ if self._invalid_choice == "complain" and self._value_is_invalid(value):
+ defval = "invalid"
+ options.append((defval, _("(element does not exist anymore)")))
+
if len(options) == 0:
html.write(self._empty_text)
elif len(options[0]) == 3:
@@ -1294,7 +1299,10 @@ class DropdownChoice(ValueSpec):
val = entry[0]
if sel == str(n):
return val
- return self.default_value() # can only happen if user garbled URL or len(choices) == 0
+ if self._invalid_choice == "replace":
+ return self.default_value() # garbled URL or len(choices) == 0
+ else:
+ raise MKUserError(varprefix, _("The selected element is not longer available. Please select something else."))
def validate_value(self, value, varprefix):
if self._no_preselect and value == self._no_preselect_value:
@@ -1314,6 +1322,12 @@ class DropdownChoice(ValueSpec):
raise MKUserError(varprefix, _("Invalid value %s, must be in %s") %
(value, ", ".join([v for (v,t) in choices])))
+ def _value_is_invalid(self, value):
+ for entry in self.choices():
+ if entry[0] == value:
+ return False
+ return True
+
# Special conveniance variant for monitoring states
class MonitoringState(DropdownChoice):
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 64f5cf3..102d926 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -10495,6 +10495,7 @@ class UserSelection(DropdownChoice):
def __init__(self, **kwargs):
only_contacts = kwargs.get("only_contacts", False)
kwargs["choices"] = generate_wato_users_elements_function(kwargs.get("none"), only_contacts = only_contacts)
+ kwargs["invalid_choice"] = "complain" # handle vanished users correctly!
DropdownChoice.__init__(self, **kwargs)
def value_to_text(self, value):
Module: check_mk
Branch: master
Commit: 9ae41d13a7a003547d850ad9ac467d885c951cf4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9ae41d13a7a003…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jan 19 12:02:32 2016 +0100
#2828 FIX win_disks: now able to handle disks with missing size or media type information
---
.werks/2828 | 9 +++++++++
ChangeLog | 1 +
inventory/win_disks | 6 ++++--
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/2828 b/.werks/2828
new file mode 100644
index 0000000..1765109
--- /dev/null
+++ b/.werks/2828
@@ -0,0 +1,9 @@
+Title: win_disks: now able to handle disks with missing size or media type information
+Level: 1
+Component: inv
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453201303
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 3da32c6..248f06a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -284,6 +284,7 @@
* 2714 FIX: Fixed visibility of folding arrows by making them dark
* 2439 FIX: solaris_prtdiag: Can now handle Oracle Corporation SUN FIRE X4170 M2 SERVER...
* 2827 FIX: win_disks, win_video: now able to detect multiple instances
+ * 2828 FIX: win_disks: now able to handle disks with missing size or media type information
1.2.7i3:
diff --git a/inventory/win_disks b/inventory/win_disks
index aa04853..1884f99 100644
--- a/inventory/win_disks
+++ b/inventory/win_disks
@@ -88,9 +88,11 @@ def inv_win_disks(info):
elif varname == "SerialNumber":
array["serial"] = value
elif varname == "Size":
- array["size"] = int(value)
+ if value != "":
+ array["size"] = int(value)
elif varname == "MediaType":
- array["type"] = value
+ if value != "":
+ array["type"] = value
elif varname == "Signature":
if value != "":
array["signature"] = int(value)
Module: check_mk
Branch: master
Commit: 35146d94a2e43d90d998090680ca1ad385f5b1a3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=35146d94a2e43d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jan 18 15:21:28 2016 +0100
The web cron url is now writing OK when finished. Just to be sure it did not fail silently.
---
web/htdocs/cron.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/web/htdocs/cron.py b/web/htdocs/cron.py
index 7812478..92c69a8 100644
--- a/web/htdocs/cron.py
+++ b/web/htdocs/cron.py
@@ -71,3 +71,5 @@ def page_run_cron():
import traceback
logger(LOG_ERR, "Exception in cron_job [%s]:\n%s" %
(cron_job.__name__, traceback.format_exc()))
+
+ html.write("OK\n")
Module: check_mk
Branch: master
Commit: 93c57c2330cad814a3d2aed87e2d6f26f2c40b68
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=93c57c2330cad8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jan 18 15:22:15 2016 +0100
value_to_text() of Dictionaries can now return a custom text when the value is at default value
---
web/htdocs/valuespec.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 4b40b57..3e77416 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -2771,6 +2771,10 @@ class Dictionary(ValueSpec):
ValueSpec.__init__(self, **kwargs)
self._elements = kwargs["elements"]
self._empty_text = kwargs.get("empty_text", _("(no parameters)"))
+ # Optionally a text can be specified to be shown by value_to_text()
+ # when the value equal the default value of the value spec. Normally
+ # the default values are shown.
+ self._default_text = kwargs.get("default_text", None)
self._required_keys = kwargs.get("required_keys", [])
self._ignored_keys = kwargs.get("ignored_keys", [])
self._default_keys = kwargs.get("default_keys", []) # keys present in default value
@@ -2965,6 +2969,9 @@ class Dictionary(ValueSpec):
if not value:
return self._empty_text
+ if self._default_text and value == self.default_value():
+ return self._default_text
+
if not oneline:
s = '<table class=vs_dict_text>'
else: