summaryrefslogtreecommitdiff
path: root/kvmd/plugins/msd/otg/__init__.py
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-03-17 15:24:20 +0200
committerMaxim Devaev <[email protected]>2023-03-17 20:29:30 +0200
commit2189512e0b5b04da676bf6e3ed745f4429a2c904 (patch)
tree624a4cccbec01bfccba5f858cced8bc48f737026 /kvmd/plugins/msd/otg/__init__.py
parent921d7da513c663eaaa690472beccb0d8d0c5a310 (diff)
renamed some msd methods
Diffstat (limited to 'kvmd/plugins/msd/otg/__init__.py')
-rw-r--r--kvmd/plugins/msd/otg/__init__.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/kvmd/plugins/msd/otg/__init__.py b/kvmd/plugins/msd/otg/__init__.py
index 02b9ceeb..50b8aa72 100644
--- a/kvmd/plugins/msd/otg/__init__.py
+++ b/kvmd/plugins/msd/otg/__init__.py
@@ -399,7 +399,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
async def __STORAGE_create_new_image(self, name: str) -> Image: # pylint: disable=invalid-name
assert self.__state.storage
- image = await self.__storage.get_image_by_name(name)
+ image = await self.__storage.make_image_by_name(name)
if image.name in self.__state.storage.images or (await image.exists()):
raise MsdImageExistsError()
return image
@@ -461,7 +461,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
logger = get_logger(0)
async with self.__state._lock: # pylint: disable=protected-access
try:
- drive_state = await self.__get_drive_state()
+ drive_state = await self.__make_init_drive_state()
if self.__state.vd is None and drive_state.image is None:
# Если только что включились и образ не подключен - попробовать
@@ -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 = await self.__get_storage_state()
+ storage_state = await self.__make_init_storage_state()
except Exception:
logger.exception("Error while reloading MSD state; switching to offline")
@@ -500,7 +500,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
async def __setup_initial(self) -> None:
if self.__initial_image:
logger = get_logger(0)
- image = await self.__storage.get_image_by_name(self.__initial_image)
+ image = await self.__storage.make_image_by_name(self.__initial_image)
if (await image.exists()):
logger.info("Setting up initial image %r ...", self.__initial_image)
try:
@@ -514,7 +514,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
# =====
- async def __get_storage_state(self) -> _StorageState:
+ async def __make_init_storage_state(self) -> _StorageState:
images = await self.__storage.get_images()
space = self.__storage.get_space(fatal=True)
assert space
@@ -524,10 +524,10 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
images=images,
)
- async def __get_drive_state(self) -> _DriveState:
+ async def __make_init_drive_state(self) -> _DriveState:
path = self.__drive.get_image_path()
return _DriveState(
- image=((await self.__storage.get_image_by_path(path)) if path else None),
+ image=((await self.__storage.make_image_by_path(path)) if path else None),
cdrom=self.__drive.get_cdrom_flag(),
rw=self.__drive.get_rw_flag(),
)