From c17abc85d3b2151ab24ee8eebe016c791e7c2d91 Mon Sep 17 00:00:00 2001 From: Sanghun Lee Date: Thu, 7 Mar 2024 14:08:12 +0900 Subject: [PATCH] fix: send delete-forever request in client --- src/ai/backend/client/cli/vfolder.py | 4 ++-- src/ai/backend/client/func/vfolder.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ai/backend/client/cli/vfolder.py b/src/ai/backend/client/cli/vfolder.py index e3fe29525b..94371fbdf2 100644 --- a/src/ai/backend/client/cli/vfolder.py +++ b/src/ai/backend/client/cli/vfolder.py @@ -148,9 +148,9 @@ def create(name, host, group, host_path, usage_mode, permission, cloneable): sys.exit(ExitCode.FAILURE) -@vfolder.command() +@vfolder.command(aliases=["move-to-trash"]) @click.argument("name", type=str) -def move_to_trash(name): +def trash(name): """Move the given virtual folder to trash-bin. The virtual folder will be under `delete-pending` status. This operation can be retracted by calling `restore()`. diff --git a/src/ai/backend/client/func/vfolder.py b/src/ai/backend/client/func/vfolder.py index 40c20ea26c..78c7c52c70 100644 --- a/src/ai/backend/client/func/vfolder.py +++ b/src/ai/backend/client/func/vfolder.py @@ -292,7 +292,8 @@ async def delete_forever(self) -> Mapping[str, Any]: rqst.set_json({ "id": self.id.hex, }) - return {} + async with rqst.fetch(): + return {} @api_function async def rename(self, new_name):