diff options
author | Devaev Maxim <[email protected]> | 2019-09-12 03:14:43 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-09-12 03:14:43 +0300 |
commit | 22d329c1fbd3affe99f7f9b252ecf85a84b098b7 (patch) | |
tree | af0299e6c0710392569e5687b86f202c54a40347 /kvmd/apps | |
parent | 57b8df010634485c9eb23e7998e003dcc0849e20 (diff) |
fixed cleanup message for plugins
Diffstat (limited to 'kvmd/apps')
-rw-r--r-- | kvmd/apps/kvmd/server.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/kvmd/apps/kvmd/server.py b/kvmd/apps/kvmd/server.py index 2f4b5aa7..e3413683 100644 --- a/kvmd/apps/kvmd/server.py +++ b/kvmd/apps/kvmd/server.py @@ -42,6 +42,8 @@ import setproctitle from ...logging import get_logger +from ...plugins import BasePlugin + from ...plugins.hid import BaseHid from ...plugins.atx import AtxOperationError @@ -570,18 +572,20 @@ class Server: # pylint: disable=too-many-instance-attributes async def __on_cleanup(self, _: aiohttp.web.Application) -> None: logger = get_logger(0) - for obj in [ - self._auth_manager, - self.__streamer, - self.__msd, - self.__atx, - self.__hid, + for (name, obj) in [ + ("Auth manager", self._auth_manager), + ("Streamer", self.__streamer), + ("MSD", self.__msd), + ("ATX", self.__atx), + ("HID", self.__hid), ]: - logger.info("Cleaning up %s ...", type(obj).__name__) + if isinstance(obj, BasePlugin): + name = f"{name} ({obj.get_plugin_name()})" + logger.info("Cleaning up %s ...", name) try: await obj.cleanup() # type: ignore except Exception: - logger.exception("Cleanup error on %s", type(obj).__name__) + logger.exception("Cleanup error on %s", name) async def __broadcast_event(self, event_type: _Events, event_attrs: Dict) -> None: if self.__sockets: |