Skip to content
Snippets Groups Projects
Commit 5ec31b4e authored by Nicolas KAROLAK's avatar Nicolas KAROLAK
Browse files

add domain into warnings and errors

parent 21bdf159
No related branches found
No related tags found
No related merge requests found
...@@ -103,10 +103,10 @@ def test_vhost( ...@@ -103,10 +103,10 @@ def test_vhost(
try: try:
ip = socket.gethostbyname(domain) ip = socket.gethostbyname(domain)
except Exception as e: except Exception as e:
ip_error = f"domain: not resolved {e}" ip_error = f"{domain} not resolved: {e}"
else: else:
if ip != "127.0.0.1": if ip != "127.0.0.1":
ip_warning = f"domain: resolve to {ip} instead of 127.0.0.1" ip_warning = f"{domain} resolve to {ip} instead of 127.0.0.1"
if ip_error: if ip_error:
if resolution_ignored and domain in resolution_ignored: if resolution_ignored and domain in resolution_ignored:
u.info(f"{ip_error} (ignored)") u.info(f"{ip_error} (ignored)")
...@@ -137,11 +137,11 @@ def test_vhost( ...@@ -137,11 +137,11 @@ def test_vhost(
or domain == "localhost" or domain == "localhost"
and code not in (200, 401, 403, 404) and code not in (200, 401, 403, 404)
): ):
u.error(f"status: {code}, {req_time}ms") u.error(f"{domain} status: {code}, {req_time}ms")
req_error = True req_error = True
else: else:
if req_time > 10000: if req_time > 10000:
u.warning(f"status: {code}, {req_time}ms") u.warning(f"{domain} status: {code}, {req_time}ms")
warnings += 1 warnings += 1
if "mediaserver" in name and wowza_dir: if "mediaserver" in name and wowza_dir:
# test /streaming url # test /streaming url
...@@ -159,10 +159,10 @@ def test_vhost( ...@@ -159,10 +159,10 @@ def test_vhost(
else: else:
code = req.status_code code = req.status_code
if code != 200: if code != 200:
u.error(f"streaming: {code}, {req_time}ms") u.error(f"{domain} streaming: {code}, {req_time}ms")
req_error = True req_error = True
elif req_time > 10000: elif req_time > 10000:
u.warning(f"streaming: {code}, {req_time}ms") u.warning(f"{domain} streaming: {code}, {req_time}ms")
warnings += 1 warnings += 1
tested += 1 tested += 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment