From 84563553b8a2f00bbb4b1559029f77ad225627f4 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Sun, 19 Mar 2023 01:17:31 +0200 Subject: fixed msd parts api --- kvmd/plugins/msd/otg/storage.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'kvmd/plugins') diff --git a/kvmd/plugins/msd/otg/storage.py b/kvmd/plugins/msd/otg/storage.py index 08853947..e4339fed 100644 --- a/kvmd/plugins/msd/otg/storage.py +++ b/kvmd/plugins/msd/otg/storage.py @@ -152,7 +152,10 @@ class _Part(_PartDc): async def _reload(self) -> None: # Only for Storage() st = await aiotools.run_async(os.statvfs, self.__path) - writable = await aiofiles.os.access(self.__path, os.W_OK) # type: ignore + if self.name == "": + writable = True + else: + writable = await aiofiles.os.access(self.__path, os.W_OK) # type: ignore object.__setattr__(self, "size", st.f_blocks * st.f_frsize) object.__setattr__(self, "free", st.f_bavail * st.f_frsize) object.__setattr__(self, "writable", writable) -- cgit v1.2.3