summaryrefslogtreecommitdiff
path: root/kvmd/plugins
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-05-18 13:34:23 +0300
committerDevaev Maxim <[email protected]>2020-05-18 13:34:23 +0300
commit028e0b06ff6730e309e1d3c7fb6abebb81360f5b (patch)
tree981760a61c3645ad85b6327dadbde3194d31c9e2 /kvmd/plugins
parent3947640771a8d212e13196808679ba3caa1c411d (diff)
refactoring
Diffstat (limited to 'kvmd/plugins')
-rw-r--r--kvmd/plugins/auth/http.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/kvmd/plugins/auth/http.py b/kvmd/plugins/auth/http.py
index 2daf5540..6cd959ae 100644
--- a/kvmd/plugins/auth/http.py
+++ b/kvmd/plugins/auth/http.py
@@ -34,6 +34,7 @@ from ...validators.basic import valid_float_f01
from ...logging import get_logger
from ... import make_user_agent
+from ... import aiotools
from . import BaseAuthService
@@ -89,10 +90,8 @@ class Plugin(BaseAuthService):
"X-KVMD-User": user,
},
) as response:
- response.raise_for_status()
- if response.status == 200:
- return True
- raise RuntimeError(f"Invalid OK response: {response.status} {await response.text()}; expected 200")
+ aiotools.raise_not_200(response)
+ return True
except Exception:
get_logger().exception("Failed HTTP auth request for user %r", user)
return False