]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
radhttpcheck: Fix doc link
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 24 May 2023 02:15:56 +0000 (22:15 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 24 May 2023 02:15:56 +0000 (22:15 -0400)
scripts/health/radhttpcheck/radhttpcheck.py
scripts/health/radhttpcheck/radhttpcheck.service

index 952d108df2778b6b684311910dd214d603ed5d37..9d7e0674e6d7d6e0363d353daa120a7160f34da3 100755 (executable)
@@ -112,19 +112,19 @@ class RadiusHealthCheckHandler(BaseHTTPRequestHandler):
         req.add_message_authenticator()
 
         # We now block until retries and timeout have expired
-        rsp = None
         try:
             rsp = client.SendPacket(req)
         except pyrad.packet.PacketError as e:
             self.genericResponse(502, json.dumps({"msg": "Healthcheck error: " + str(e) })) # BadGateway
+            return
         except pyrad.client.Timeout as e:
             self.genericResponse(504, json.dumps({"msg": "Healthcheck error: No response from upstream"})) # Gateway timeout
+            return
         except Exception as e:
             self.genericResponse(500, json.dumps({"msg": "Internal error: " + str(e) })) # Internal error
+            return
         finally:
             del client # Ensure the socket is closed in a timely fashion
-        if not rsp:
-            return
 
         # Deal with response code mismatches
         if healthcheck['require_ack'] and healthcheck['type'].has_key('rsp_code') and rsp.code != healthcheck['type']['rsp_code']:
index 90af85873fb7d41a6bfdfebf5f47becfe55bf204..0e33eaf48e0c27896de04a68c8c9392660b85b3a 100644 (file)
@@ -1,7 +1,7 @@
 [Unit]
 Description=radhttpcheck health probe translator
 After=network-online.target
-Documentation=raddhtpcheck/README.md
+Documentation=https://github.com/FreeRADIUS/freeradius-server/blob/master/scripts/health/radhttpcheck/README.md
 
 [Service]
 Type=exec