diff options
author | Devaev Maxim <[email protected]> | 2020-06-05 06:27:23 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-06-05 06:27:23 +0300 |
commit | 83a8eb8dd2d0a8e7734ea47f8c186f762d6a57ff (patch) | |
tree | 587e2f83cd389cb0d5fd4f947aad8e4be1e079cd /kvmd/apps/ipmi | |
parent | 1eb440b060d412f4f65431f8e3a2feed446facfd (diff) |
proper logs
Diffstat (limited to 'kvmd/apps/ipmi')
-rw-r--r-- | kvmd/apps/ipmi/server.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kvmd/apps/ipmi/server.py b/kvmd/apps/ipmi/server.py index 084656de..ede6d786 100644 --- a/kvmd/apps/ipmi/server.py +++ b/kvmd/apps/ipmi/server.py @@ -88,8 +88,8 @@ class IpmiServer(BaseIpmiServer): # pylint: disable=too-many-instance-attribute except (aiohttp.ClientError, asyncio.TimeoutError): session.send_ipmi_response(code=0xFF) except Exception: - get_logger(0).exception("Unexpected exception while handling IPMI request: netfn=%d; command=%d", - request["netfn"], request["command"]) + get_logger(0).exception("[%s]: Unexpected exception while handling IPMI request: netfn=%d; command=%d", + session.sockaddr[0], request["netfn"], request["command"]) session.send_ipmi_response(code=0xFF) else: session.send_ipmi_response(code=0xC1) @@ -121,14 +121,14 @@ class IpmiServer(BaseIpmiServer): # pylint: disable=too-many-instance-attribute async def runner(): # type: ignore logger = get_logger(0) credentials = self.__auth_manager.get_credentials(session.username.decode()) - logger.info("Client %s: Performing request %s from user %r (IPMI) as %r (KVMD)", + logger.info("[%s]: Performing request %s from user %r (IPMI) as %r (KVMD)", session.sockaddr[0], name, credentials.ipmi_user, credentials.kvmd_user) try: async with self.__kvmd.make_session(credentials.kvmd_user, credentials.kvmd_passwd) as kvmd_session: 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, err) + logger.error("[%s]: Can't perform request %s: %s", session.sockaddr[0], name, err) raise return aiotools.run_sync(runner()) |