Skip to content
This repository was archived by the owner on Sep 22, 2023. It is now read-only.

Commit c33b036

Browse files
authored
fix: Naming/defaults of new vfolder args (#137)
* `allow_clone` error: Reorder the double-dashed cli arguments to let Click mangle the correct parameter name * `quota` type error: Always provide a valid binary-size string, with the "unconstrained" default zero
1 parent 8b630dc commit c33b036

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

changes/137.fix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix naming and defaults of new vfolder creation parameters `cloneable` and `quota` (added in APIv6) for both the functional SDK and the CLI arguments

src/ai/backend/client/cli/vfolder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ def list_allowed_types():
9292
help='Folder\'s innate permission. '
9393
'Group folders can be shared as read-only by setting this option to "ro".'
9494
'Invited folders override this setting by its own invitation permission.')
95-
@click.option('-q', '--quota', metavar='QUOTA', type=ByteSizeParamCheckType(), default=None,
95+
@click.option('-q', '--quota', metavar='QUOTA', type=ByteSizeParamCheckType(), default='0',
9696
help='Quota of the virtual folder. '
9797
'(Use \'m\' for megabytes, \'g\' for gigabytes, and etc.) '
9898
'Default is maximum amount possible.')
99-
@click.option('--allow-clone', '--cloneable', type=bool, is_flag=True,
99+
@click.option('--cloneable', '--allow-clone', type=bool, is_flag=True,
100100
help='Allows the virtual folder to be cloned by users.')
101101
def create(name, host, group, host_path, usage_mode, permission, quota, cloneable):
102102
'''Create a new virtual folder.

src/ai/backend/client/func/vfolder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async def create(
3737
group: str = None,
3838
usage_mode: str = 'general',
3939
permission: str = 'rw',
40-
quota: str = None,
40+
quota: str = '0',
4141
cloneable: bool = False
4242
):
4343
rqst = Request('POST', '/folders')

0 commit comments

Comments
 (0)