diff options
author | Maxim Devaev <[email protected]> | 2022-07-23 05:02:53 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-07-24 05:38:26 +0300 |
commit | aa5a538c64f8ef8fe268bf1f78b44a0d70f14389 (patch) | |
tree | 0cec5197ef951193e0651406a20c634d981987c1 | |
parent | 2eef9bd26394f5f98f1324012a3c77570e80a7e2 (diff) |
refactoring
-rw-r--r-- | kvmd/plugins/msd/otg/__init__.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/kvmd/plugins/msd/otg/__init__.py b/kvmd/plugins/msd/otg/__init__.py index 8aea3d34..3a2250e8 100644 --- a/kvmd/plugins/msd/otg/__init__.py +++ b/kvmd/plugins/msd/otg/__init__.py @@ -328,7 +328,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes if name in self.__state.storage.images or os.path.exists(path): raise MsdImageExistsError() - await self.__remount_storage(rw=True) + await self.__remount_rw(True) self.__set_image_complete(name, False) self.__new_writer = await MsdImageWriter(path, size, self.__sync_chunk_size).open() @@ -340,7 +340,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes finally: await self.__close_new_writer() try: - await self.__remount_storage(rw=False) + await self.__remount_rw(False) except Exception: pass finally: @@ -377,10 +377,10 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes self.__state.vd.image = None del self.__state.storage.images[name] - await self.__remount_storage(rw=True) + await self.__remount_rw(True) os.remove(image.path) self.__set_image_complete(name, False) - await self.__remount_storage(rw=False) + await self.__remount_rw(False) # ===== @@ -450,8 +450,8 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes # Если только что включились и образ не подключен - попробовать # перемонтировать хранилище (и создать images и meta). logger.info("Probing to remount storage ...") - await self.__remount_storage(rw=True) - await self.__remount_storage(rw=False) + await self.__remount_rw(True) + await self.__remount_rw(False) await self.__setup_initial() storage_state = self.__get_storage_state() @@ -550,6 +550,6 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes # ===== - async def __remount_storage(self, rw: bool) -> None: + async def __remount_rw(self, rw: bool) -> None: if not (await aiohelpers.remount("MSD", self.__remount_cmd, rw)): raise MsdError("Can't execute remount helper") |