Module: check_mk
Branch: master
Commit: 86aae873f19bbc65b6ff79c83b584a247811395c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=86aae873f19bbc…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri May 25 11:20:42 2012 +0200
Fix default value of ValueSpec Dictionary
---
web/htdocs/valuespec.py | 8 ++++++++
web/plugins/wato/active_checks.py | 3 ++-
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 07cc648..62ee869 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1656,6 +1656,14 @@ class Dictionary(ValueSpec):
in self._elements
if name in self._required_keys or not self._optional_keys])
+ def default_value(self):
+ def_val = {}
+ for name, vs in self._elements:
+ if name in self._required_keys or not self._optional_keys:
+ def_val[name] = vs.default_value()
+
+ return def_val
+
def value_to_text(self, value):
parts = []
for param, vs in self._elements:
diff --git a/web/plugins/wato/active_checks.py b/web/plugins/wato/active_checks.py
index ea82ea6..215578f 100644
--- a/web/plugins/wato/active_checks.py
+++ b/web/plugins/wato/active_checks.py
@@ -503,7 +503,8 @@ register_rule(group,
title = _("Service description"),
help = _("Please make sure that this is unique per host "
"and does not collide with other services."),
- allow_empty = False)
+ allow_empty = False,
+ default_value = _("Customcheck"))
),
( "command_line",
TextAscii(