summaryrefslogtreecommitdiff
path: root/kvmd
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-05-25 01:52:37 +0300
committerDevaev Maxim <[email protected]>2020-05-25 01:52:37 +0300
commite6f8396661b3c12e0cc72941f9b8e635989469fa (patch)
tree0ef5df151a8404b63bf41ac0ac48f369c4ba53eb /kvmd
parentd5dca5a8b4eadd988505a6d84e2807cbea6c6d11 (diff)
refactoring
Diffstat (limited to 'kvmd')
-rw-r--r--kvmd/apps/ipmi/server.py2
-rw-r--r--kvmd/apps/kvmd/info.py2
-rw-r--r--kvmd/apps/vnc/rfb/__init__.py4
-rw-r--r--kvmd/apps/vnc/server.py2
-rw-r--r--kvmd/validators/net.py2
5 files changed, 6 insertions, 6 deletions
diff --git a/kvmd/apps/ipmi/server.py b/kvmd/apps/ipmi/server.py
index 7ef99670..1173d395 100644
--- a/kvmd/apps/ipmi/server.py
+++ b/kvmd/apps/ipmi/server.py
@@ -128,7 +128,7 @@ class IpmiServer(BaseIpmiServer): # pylint: disable=too-many-instance-attribute
method = functools.reduce(getattr, method_path.split("."), kvmd_session)
return (await method(**kwargs))
except (aiohttp.ClientError, asyncio.TimeoutError) as err:
- logger.error("Can't perform request %s: %s", name, str(err))
+ logger.error("Can't perform request %s: %s", name, err)
raise
return aiotools.run_sync(runner())
diff --git a/kvmd/apps/kvmd/info.py b/kvmd/apps/kvmd/info.py
index fe4a332c..50ea6eb1 100644
--- a/kvmd/apps/kvmd/info.py
+++ b/kvmd/apps/kvmd/info.py
@@ -99,5 +99,5 @@ class InfoManager:
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__, str(err))
+ get_logger(0).error("Can't get info about the service %r: %s: %s", name, type(err).__name__, err)
return True
diff --git a/kvmd/apps/vnc/rfb/__init__.py b/kvmd/apps/vnc/rfb/__init__.py
index 279c18bf..b5d690b3 100644
--- a/kvmd/apps/vnc/rfb/__init__.py
+++ b/kvmd/apps/vnc/rfb/__init__.py
@@ -106,9 +106,9 @@ class RfbClient(RfbClientStream): # pylint: disable=too-many-instance-attribute
logger.info("[%s] Client %s: Cancelling subtask ...", name, self._remote)
raise
except RfbConnectionError as err:
- logger.info("[%s] Client %s: Gone: %s", name, self._remote, str(err))
+ logger.info("[%s] Client %s: Gone: %s", name, self._remote, err)
except (RfbError, ssl.SSLError) as err:
- logger.error("[%s] Client %s: Error: %s", name, self._remote, str(err))
+ logger.error("[%s] Client %s: Error: %s", name, self._remote, err)
except Exception:
logger.exception("[%s] Unhandled exception with client %s", name, self._remote)
diff --git a/kvmd/apps/vnc/server.py b/kvmd/apps/vnc/server.py
index c7d376d8..015b4581 100644
--- a/kvmd/apps/vnc/server.py
+++ b/kvmd/apps/vnc/server.py
@@ -180,7 +180,7 @@ class _Client(RfbClient): # pylint: disable=too-many-instance-attributes
else:
await self.__send_fb_stub("No signal")
except StreamerError as err:
- logger.info("[streamer] Client %s: Waiting for stream: %s", self._remote, str(err))
+ logger.info("[streamer] Client %s: Waiting for stream: %s", self._remote, err)
await self.__send_fb_stub("Waiting for stream ...")
await asyncio.sleep(1)
diff --git a/kvmd/validators/net.py b/kvmd/validators/net.py
index 7862c391..3c172e7b 100644
--- a/kvmd/validators/net.py
+++ b/kvmd/validators/net.py
@@ -85,5 +85,5 @@ def valid_ssl_ciphers(arg: Any) -> str:
try:
ssl.SSLContext().set_ciphers(arg)
except Exception as err:
- raise ValidatorError(f"The argument {arg!r} is not a valid {name}: {str(err)}")
+ raise ValidatorError(f"The argument {arg!r} is not a valid {name}: {err}")
return arg