Add the argument `disk_type` validation in the method `DecortController.account_disks`

main
Dmitriy Smirnov 7 months ago
parent aefc920e1a
commit 0c0fde8470

@ -141,7 +141,7 @@ class DecortAccountInfo(DecortController):
),
type=dict(
type='str',
choices=['B', 'D'],
choices=self.DISK_TYPES,
),
),
),

@ -121,6 +121,8 @@ class DecortController(object):
'STOPPING',
]
DISK_TYPES = ['B', 'D']
RESOURCE_GROUP_STATUSES = [
'CREATED',
'DELETED',
@ -2448,6 +2450,15 @@ class DecortController(object):
`/cloudapi/account/listDisks`.
"""
if disk_type and (
not disk_type in self.DISK_TYPES
):
self.result['msg'] = (
f'{disk_type} is not valid disk type'
f' for filtering account disk list.'
)
self.amodule.fail_json(**self.result)
sort_by = None
if sort_by_field:
if not sort_by_field in self.FIELDS_FOR_SORTING_ACCOUNT_DISK_LIST:

Loading…
Cancel
Save