Commit 5fc3e476 authored by Vladimir Komarov's avatar Vladimir Komarov
Browse files

vak-1594 changed Radius Exception.

parent 10dfe52b
Pipeline #32145 passed with stages
in 15 minutes and 18 seconds
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
# Third-party modules # Third-party modules
import pyrad
from pyrad.packet import AccessAccept, AccessRequest from pyrad.packet import AccessAccept, AccessRequest
from pyrad.client import Client from pyrad.client import Client
from pyrad.dictionary import Dictionary from pyrad.dictionary import Dictionary
...@@ -29,7 +30,7 @@ class RADIUSBackend(BaseAuthBackend): ...@@ -29,7 +30,7 @@ class RADIUSBackend(BaseAuthBackend):
req["User-Password"] = req.PwCrypt(password) req["User-Password"] = req.PwCrypt(password)
try: try:
reply = client.SendPacket(req) reply = client.SendPacket(req)
except client.Timeout: except pyrad.client.Timeout:
raise self.LoginError("Timed out") raise self.LoginError("Timed out")
if reply.code != AccessAccept: if reply.code != AccessAccept:
raise self.LoginError("RADIUS Authentication failed. Code=%s", reply.code) raise self.LoginError("RADIUS Authentication failed. Code=%s", reply.code)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment