summaryrefslogtreecommitdiff
path: root/kvmd/apps
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2021-01-23 07:00:49 +0300
committerDevaev Maxim <[email protected]>2021-01-23 07:00:49 +0300
commit4d4fb69d2eb2e9b3d677b82098d888bd899c8c33 (patch)
treec193f2a0db5fb34f5f58bd96d6ccd771177b1753 /kvmd/apps
parentebe40697a5935d5d35a36d0825715ca8c3824c6a (diff)
refactoring
Diffstat (limited to 'kvmd/apps')
-rw-r--r--kvmd/apps/kvmd/info/extras.py3
-rw-r--r--kvmd/apps/kvmd/streamer.py2
-rw-r--r--kvmd/apps/vnc/server.py4
3 files changed, 6 insertions, 3 deletions
diff --git a/kvmd/apps/kvmd/info/extras.py b/kvmd/apps/kvmd/info/extras.py
index b471a6ca..6024aebc 100644
--- a/kvmd/apps/kvmd/info/extras.py
+++ b/kvmd/apps/kvmd/info/extras.py
@@ -34,6 +34,7 @@ from ....logging import get_logger
from ....yamlconf import Section
from ....yamlconf.loader import load_yaml_file
+from .... import tools
from .... import aiotools
from .base import BaseInfoSubmanager
@@ -98,5 +99,5 @@ class ExtrasInfoSubmanager(BaseInfoSubmanager):
return (enabled or (manager.GetUnitFileState(name) in ["enabled", "enabled-runtime", "static", "indirect", "generated"]))
except Exception as err:
- get_logger(0).error("Can't get info about the service %r: %s: %s", name, type(err).__name__, err)
+ get_logger(0).error("Can't get info about the service %r: %s", name, tools.efmt(err))
return True
diff --git a/kvmd/apps/kvmd/streamer.py b/kvmd/apps/kvmd/streamer.py
index 77c1302c..0069ad94 100644
--- a/kvmd/apps/kvmd/streamer.py
+++ b/kvmd/apps/kvmd/streamer.py
@@ -325,7 +325,7 @@ class Streamer: # pylint: disable=too-many-instance-attributes
return snapshot
logger.error("Stream is offline, no signal or so")
except (aiohttp.ClientConnectionError, aiohttp.ServerConnectionError) as err:
- logger.error("Can't connect to streamer: %s: %s", type(err).__name__, err)
+ logger.error("Can't connect to streamer: %s", tools.efmt(err))
except Exception:
logger.exception("Invalid streamer response from /snapshot")
return None
diff --git a/kvmd/apps/vnc/server.py b/kvmd/apps/vnc/server.py
index 14617311..d00360a6 100644
--- a/kvmd/apps/vnc/server.py
+++ b/kvmd/apps/vnc/server.py
@@ -50,6 +50,8 @@ from ...clients.streamer import BaseStreamerClient
from ...clients.streamer import StreamerHttpClient
from ...clients.streamer import StreamerMemsinkClient
+from ... import tools
+
from .rfb import RfbClient
from .rfb.stream import rfb_format_remote
from .rfb.stream import rfb_close_writer
@@ -397,7 +399,7 @@ class VncServer: # pylint: disable=too-many-instance-attributes
async with kvmd.make_session("", "") as kvmd_session:
none_auth_only = await kvmd_session.auth.check()
except (aiohttp.ClientError, asyncio.TimeoutError) as err:
- logger.error("[entry] %s: Can't check KVMD auth mode: %s: %s", remote, type(err).__name__, err)
+ logger.error("[entry] %s: Can't check KVMD auth mode: %s", remote, tools.efmt(err))
return
await _Client(