Module: check_mk
Branch: master
Commit: 575ae7e948e29001084f12c14ba06c7335bf6102
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=575ae7e948e290…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Oct 5 13:14:09 2017 +0200
TextOrRegExp can now hand over allow_empty attribute to sub valuespecs
Change-Id: I59583a34b22701829f8e8002815852308612db0e
---
web/htdocs/valuespec.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index dbbcdbe..2f2cb3c 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -4098,16 +4098,20 @@ class TextOrRegExp(Alternative):
_regex_valuespec_class = RegExp
def __init__(self, **kwargs):
+ allow_empty = kwargs.pop("allow_empty", True)
+
if "text_valuespec" in kwargs:
vs_text = kwargs.pop("text_valuespec")
else:
vs_text = self._text_valuespec_class(
title = _("Explicit match"),
+ allow_empty = allow_empty,
)
vs_regex = self._regex_valuespec_class(
mode = RegExp.prefix,
title = _("Regular expression match"),
+ allow_empty = allow_empty,
)
kwargs.update({