diff options
author | Maxim Devaev <[email protected]> | 2022-08-04 04:04:10 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-08-04 04:04:10 +0300 |
commit | 9ee63aba3ead6493acd01c89ffe17c503cdb4017 (patch) | |
tree | 16b2ee2c5daf1a45f255fc3b2d8d5bd1e79de94b /kvmd/plugins/msd/disabled.py | |
parent | 9925198762ab355343eb759e8117827a17645508 (diff) |
refactored msd writer api
Diffstat (limited to 'kvmd/plugins/msd/disabled.py')
-rw-r--r-- | kvmd/plugins/msd/disabled.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/kvmd/plugins/msd/disabled.py b/kvmd/plugins/msd/disabled.py index 5317fb09..a1c2b752 100644 --- a/kvmd/plugins/msd/disabled.py +++ b/kvmd/plugins/msd/disabled.py @@ -30,6 +30,7 @@ from ... import aiotools from . import MsdOperationError from . import BaseMsdReader +from . import BaseMsdWriter from . import BaseMsd @@ -84,13 +85,10 @@ class Plugin(BaseMsd): yield BaseMsdReader() @contextlib.asynccontextmanager - async def write_image(self, name: str, size: int, remove_incomplete: Optional[bool]) -> AsyncGenerator[int, None]: + async def write_image(self, name: str, size: int, remove_incomplete: Optional[bool]) -> AsyncGenerator[BaseMsdWriter, None]: if self is not None: # XXX: Vulture and pylint hack raise MsdDisabledError() - yield 1 - - async def write_image_chunk(self, chunk: bytes) -> int: - raise MsdDisabledError() + yield BaseMsdWriter() async def remove(self, name: str) -> None: raise MsdDisabledError() |