summaryrefslogtreecommitdiff
path: root/kvmd
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-07-07 03:03:57 +0000
committerDevaev Maxim <[email protected]>2018-07-07 03:03:57 +0000
commit66eac2ca1e45b07ddf5ce52ed9c65bfd8e5e9f3c (patch)
tree0afbaf0590dd279339b5a95786d4fe51ad827687 /kvmd
parent033ad8922c6407bd9e7ca77817afdb4ed40ffc82 (diff)
refactoring
Diffstat (limited to 'kvmd')
-rw-r--r--kvmd/kvmd/msd.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/kvmd/kvmd/msd.py b/kvmd/kvmd/msd.py
index b78a2100..f4358006 100644
--- a/kvmd/kvmd/msd.py
+++ b/kvmd/kvmd/msd.py
@@ -48,7 +48,7 @@ class IsBusyError(MassStorageError):
super().__init__("Mass-storage is busy (write in progress)")
-class DeviceInfo(NamedTuple):
+class MassStorageDeviceInfo(NamedTuple):
path: str
bind: str
size: int
@@ -98,7 +98,7 @@ def _parse_disk_meta(data: bytes) -> Dict:
return disk_meta
-def explore_device(path: str) -> DeviceInfo:
+def explore_device(path: str) -> MassStorageDeviceInfo:
# udevadm info -a -p $(udevadm info -q path -n /dev/sda)
ctx = pyudev.Context()
@@ -115,7 +115,7 @@ def explore_device(path: str) -> DeviceInfo:
device_file.seek(size - _DISK_META_SIZE)
disk_meta = _parse_disk_meta(device_file.read())
- return DeviceInfo(
+ return MassStorageDeviceInfo(
path=path,
bind=storage_device.sys_name,
size=size,
@@ -157,7 +157,7 @@ class MassStorageDevice: # pylint: disable=too-many-instance-attributes
self.__write_meta = write_meta
self.__loop = loop
- self.__device_info: Optional[DeviceInfo] = None
+ self.__device_info: Optional[MassStorageDeviceInfo] = None
self._lock = asyncio.Lock()
self._device_file: Optional[aiofiles.base.AiofilesContextManager] = None
self.__writed = 0