summaryrefslogtreecommitdiff
path: root/kvmd/plugins/msd/otg/__init__.py
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-03-16 20:35:04 +0200
committerMaxim Devaev <[email protected]>2023-03-16 20:35:04 +0200
commit27f38ef086842a871ff4768ebda46e1348fee2e0 (patch)
treea1f160421539dab8682b4546bef8e3627279e199 /kvmd/plugins/msd/otg/__init__.py
parent59b1d8abbbb9225ec3164069acc74ec590b93f7b (diff)
more msd async
Diffstat (limited to 'kvmd/plugins/msd/otg/__init__.py')
-rw-r--r--kvmd/plugins/msd/otg/__init__.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/kvmd/plugins/msd/otg/__init__.py b/kvmd/plugins/msd/otg/__init__.py
index ddb90a79..53082cc6 100644
--- a/kvmd/plugins/msd/otg/__init__.py
+++ b/kvmd/plugins/msd/otg/__init__.py
@@ -431,10 +431,10 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
with Inotify() as inotify:
for path in [
- *self.__storage.get_watchable_paths(),
+ *(await self.__storage.get_watchable_paths()),
*self.__drive.get_watchable_paths(),
]:
- inotify.watch(path, InotifyMask.ALL_MODIFY_EVENTS)
+ await inotify.watch(path, InotifyMask.ALL_MODIFY_EVENTS)
# После установки вотчеров еще раз проверяем стейт, чтобы ничего не потерять
await self.__reload_state()
@@ -471,7 +471,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
await self.__storage.remount_rw(False)
await self.__setup_initial()
- storage_state = self.__get_storage_state()
+ storage_state = await self.__get_storage_state()
except Exception:
logger.exception("Error while reloading MSD state; switching to offline")
@@ -514,8 +514,8 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
# =====
- def __get_storage_state(self) -> _StorageState:
- images = self.__storage.get_images()
+ async def __get_storage_state(self) -> _StorageState:
+ images = await self.__storage.get_images()
space = self.__storage.get_space(fatal=True)
assert space
return _StorageState(