summaryrefslogtreecommitdiff
path: root/kvmd/apps/vnc
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/apps/vnc
parent3947640771a8d212e13196808679ba3caa1c411d (diff)
refactoring
Diffstat (limited to 'kvmd/apps/vnc')
-rw-r--r--kvmd/apps/vnc/__init__.py9
-rw-r--r--kvmd/apps/vnc/server.py5
2 files changed, 9 insertions, 5 deletions
diff --git a/kvmd/apps/vnc/__init__.py b/kvmd/apps/vnc/__init__.py
index 9bcc9d27..ef0f0c03 100644
--- a/kvmd/apps/vnc/__init__.py
+++ b/kvmd/apps/vnc/__init__.py
@@ -43,6 +43,8 @@ def main(argv: Optional[List[str]]=None) -> None:
argv=argv,
)[2].vnc
+ user_agent = make_user_agent("KVMD-VNC")
+
# pylint: disable=protected-access
VncServer(
host=config.server.host,
@@ -55,9 +57,12 @@ def main(argv: Optional[List[str]]=None) -> None:
desired_fps=config.desired_fps,
symmap=build_symmap(config.keymap),
- kvmd=KvmdClient(**config.kvmd._unpack()),
+ kvmd=KvmdClient(
+ user_agent=user_agent,
+ **config.kvmd._unpack(),
+ ),
streamer=StreamerClient(
- user_agent=make_user_agent("KVMD-VNC"),
+ user_agent=user_agent,
**config.streamer._unpack(),
),
vnc_auth_manager=VncAuthManager(**config.auth.vncauth._unpack()),
diff --git a/kvmd/apps/vnc/server.py b/kvmd/apps/vnc/server.py
index 12baeb20..15eb2402 100644
--- a/kvmd/apps/vnc/server.py
+++ b/kvmd/apps/vnc/server.py
@@ -34,7 +34,6 @@ import aiohttp
from ...logging import get_logger
-from ...clients.kvmd import KvmdError
from ...clients.kvmd import KvmdClient
from ...clients.streamer import StreamerError
@@ -327,8 +326,8 @@ class VncServer: # pylint: disable=too-many-instance-attributes
try:
try:
none_auth_only = await kvmd.auth.check("", "")
- except KvmdError as err:
- logger.error("Client %s: Can't check KVMD auth mode: %s", remote, err)
+ except (aiohttp.ClientError, asyncio.TimeoutError) as err:
+ logger.error("Client %s: Can't check KVMD auth mode: %s: %s", remote, type(err).__name__, err)
return
await _Client(