summaryrefslogtreecommitdiff
path: root/kvmd
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-03-06 19:29:06 +0200
committerMaxim Devaev <[email protected]>2023-03-06 19:29:06 +0200
commit49a1beab37741d53a1c37f2b5c9124788fe0b3f0 (patch)
treea85e29bad6d94370725d2595f57a8df546d89695 /kvmd
parent3c29e8f61a3a8ca1e7309436ac5130c287caeda9 (diff)
explicit image name
Diffstat (limited to 'kvmd')
-rw-r--r--kvmd/plugins/msd/__init__.py8
-rw-r--r--kvmd/plugins/msd/otg/__init__.py2
2 files changed, 6 insertions, 4 deletions
diff --git a/kvmd/plugins/msd/__init__.py b/kvmd/plugins/msd/__init__.py
index e0fc856e..34efaafe 100644
--- a/kvmd/plugins/msd/__init__.py
+++ b/kvmd/plugins/msd/__init__.py
@@ -163,9 +163,9 @@ class BaseMsd(BasePlugin):
class MsdFileReader(BaseMsdReader): # pylint: disable=too-many-instance-attributes
- def __init__(self, notifier: aiotools.AioNotifier, path: str, chunk_size: int) -> None:
+ def __init__(self, notifier: aiotools.AioNotifier, name: str, path: str, chunk_size: int) -> None:
self.__notifier = notifier
- self.__name = os.path.basename(path)
+ self.__name = name
self.__path = path
self.__chunk_size = chunk_size
@@ -222,9 +222,9 @@ class MsdFileReader(BaseMsdReader): # pylint: disable=too-many-instance-attribu
class MsdFileWriter(BaseMsdWriter): # pylint: disable=too-many-instance-attributes
- def __init__(self, notifier: aiotools.AioNotifier, path: str, file_size: int, sync_size: int, chunk_size: int) -> None:
+ def __init__(self, notifier: aiotools.AioNotifier, name: str, path: str, file_size: int, sync_size: int, chunk_size: int) -> None:
self.__notifier = notifier
- self.__name = os.path.basename(path)
+ self.__name = name
self.__path = path
self.__file_size = file_size
self.__sync_size = sync_size
diff --git a/kvmd/plugins/msd/otg/__init__.py b/kvmd/plugins/msd/otg/__init__.py
index 4155a89e..d1a9dc6a 100644
--- a/kvmd/plugins/msd/otg/__init__.py
+++ b/kvmd/plugins/msd/otg/__init__.py
@@ -307,6 +307,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
image = self.__STATE_get_storage_image(name)
self.__reader = await MsdFileReader(
notifier=self.__notifier,
+ name=image.name,
path=image.path,
chunk_size=self.__read_chunk_size,
).open()
@@ -332,6 +333,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
self.__writer = await MsdFileWriter(
notifier=self.__notifier,
+ name=image.name,
path=image.path,
file_size=size,
sync_size=self.__sync_chunk_size,