Module: check_mk
Branch: master
Commit: 13471b856a6aebac5841c7a1bb161063eed19a38
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=13471b856a6aeb…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Thu Mar 21 09:20:30 2019 +0100
check_http: simplify 'virthost' evaluation
Change-Id: I4c25aa67ac9c2919724c57ee502e4fb65f451676
---
checks/check_http | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/checks/check_http b/checks/check_http
index ef4bd93..3f5e9fe 100644
--- a/checks/check_http
+++ b/checks/check_http
@@ -85,23 +85,19 @@ def _certificate_args(address_family, address, settings):
def _url_args(address_family, address, settings):
- def _omit_ip(settings):
- if "virthost" in settings:
- return settings["virthost"][1]
- return False
+
+ # get virthost settings:
+ # TODO: when did 'vhost' dissapear from WATO?
+ vhost, omit_ip = settings.get("virthost", (settings.get("vhost"),
False))
args = []
- if (not _omit_ip(settings)) and ("proxy" not in settings):
+ if (not omit_ip) and ("proxy" not in settings):
args += ["-I", address]
elif "proxy" in settings:
args += ["-I", settings["proxy"]]
- if "vhost" in settings:
- args += ["-H", settings["vhost"]]
-
- if "virthost" in settings:
- vhost = settings["virthost"][0]
+ if vhost:
args += ["-H", vhost]
if address_family == 'ipv6':