Module: check_mk
Branch: master
Commit: d7ac3578549992c1e56ab9ee212d476cfde11e24
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d7ac3578549992…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Tue Mar 26 15:11:14 2019 +0100
WATO actice_checks: refactor portspec
Change-Id: Iefe45bc07bddd44eeda059fbcc8b19743b1c6641
---
cmk/gui/plugins/wato/active_checks.py | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/cmk/gui/plugins/wato/active_checks.py
b/cmk/gui/plugins/wato/active_checks.py
index bb8cb7b..48d5c22 100644
--- a/cmk/gui/plugins/wato/active_checks.py
+++ b/cmk/gui/plugins/wato/active_checks.py
@@ -963,6 +963,9 @@ class RulespecActiveChecksHttp(HostRulespec):
def match_type(self):
return "all"
+ def _portspec(self, default):
+ return Integer(title=_("TCP Port"), minvalue=1, maxvalue=65535,
default_value=default)
+
@property
def valuespec(self):
return Transform(
@@ -1021,12 +1024,7 @@ class RulespecActiveChecksHttp(HostRulespec):
title=_("URI to fetch (default is
<tt>/</tt>)"),
allow_empty=False,
default_value="/")),
- ("port",
- Integer(
- title=_("TCP Port"),
- minvalue=1,
- maxvalue=65535,
- default_value=80)),
+ ("port", self._portspec(80)),
_ip_address_family_element(),
("ssl",
Transform(
@@ -1286,15 +1284,7 @@ class RulespecActiveChecksHttp(HostRulespec):
"address from the host primary
address."),
),
),
- (
- "port",
- Integer(
- title=_("TCP Port"),
- minvalue=1,
- maxvalue=65535,
- default_value=443,
- ),
- ),
+ ("port", self._portspec(443)),
_ip_address_family_element(),
(
"sni",