~rjarry/dlrepo

44f9f8ede26663090009bd8c72c5371a4a14c32f — Julien Floret 11 months ago 7d14913
fs: rm return value for finalize_upload

It is not used. Thus the return value of the _check_and_move() can be
removed too.
No functional change.

Signed-off-by: Julien Floret <julien.floret@6wind.com>
Acked-by: Thomas Faivre <thomas.faivre@6wind.com>
Acked-by: Robin Jarry <robin@jarry.cc>
1 files changed, 5 insertions(+), 8 deletions(-)

M dlrepo/fs/__init__.py
M dlrepo/fs/__init__.py => dlrepo/fs/__init__.py +5 -8
@@ 73,7 73,7 @@ class AbstractRepository:
    def cancel_upload(self, uuid: str):
        raise NotImplementedError()

    async def finalize_upload(self, uuid: str, digest: str) -> Path:
    async def finalize_upload(self, uuid: str, digest: str):
        raise NotImplementedError()

    def link_blob(self, digest: str, target: Path):


@@ 265,10 265,8 @@ class ArtifactRepository(AbstractRepository):
    def cancel_upload(self, uuid: str):
        self.upload_path(uuid).unlink()

    async def finalize_upload(self, uuid: str, digest: str) -> Path:
        return await _check_and_move(
            self.upload_path(uuid), self.blob_path(digest), digest
        )
    async def finalize_upload(self, uuid: str, digest: str):
        await _check_and_move(self.upload_path(uuid), self.blob_path(digest), digest)

    def link_blob(self, digest: str, target: Path):
        _copy_or_link(self.blob_path(digest), target)


@@ 371,8 369,8 @@ class UserRepository(AbstractRepository):
    ) -> int:
        return await self.base.update_upload(uuid, stream)

    async def finalize_upload(self, uuid: str, digest: str) -> Path:
        return await self.base.finalize_upload(uuid, digest)
    async def finalize_upload(self, uuid: str, digest: str):
        await self.base.finalize_upload(uuid, digest)

    def blob_path(self, digest: str, parent: Optional[Path] = None) -> Path:
        return self.base.blob_path(digest, parent=parent)


@@ 444,4 442,3 @@ async def _check_and_move(src: Path, dst: Path, digest: str):
    dst.parent.mkdir(mode=0o755, parents=True, exist_ok=True)
    src.rename(dst)
    dst.chmod(0o644)
    return dst