[TrivialFix] Follow up per-share-gigabytes quota changes

- Add max-version in the version decorators for readability
- Move "per-share-gigabytes" command option to be alongside
  valid quotas.

Related-Bug: #1918961
Change-Id: I02817963b9c0c29add2db70256cdc61912d014a2
Depends-On: I9a0491a985fb6c36948e41419f94333ddf5d35a3
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
This commit is contained in:
Goutham Pacha Ravi 2021-05-25 16:25:53 -07:00
parent 1f31818d2f
commit 99ccf02d0b
3 changed files with 9 additions and 9 deletions

View File

@ -96,7 +96,7 @@ class QuotaClassSetManager(base.ManagerWithFind):
snapshots=snapshots, snapshot_gigabytes=snapshot_gigabytes,
share_networks=share_networks, resource_path=RESOURCE_PATH)
@api_versions.wraps(REPLICA_QUOTAS_MICROVERSION) # noqa
@api_versions.wraps(REPLICA_QUOTAS_MICROVERSION, "2.61") # noqa
def update(self, class_name, shares=None, gigabytes=None, # noqa
snapshots=None, snapshot_gigabytes=None, share_networks=None,
share_replicas=None, replica_gigabytes=None):

View File

@ -185,7 +185,7 @@ class QuotaSetManager(base.ManagerWithFind):
resource_path=RESOURCE_PATH,
)
@api_versions.wraps(REPLICA_QUOTAS_MICROVERSION) # noqa
@api_versions.wraps(REPLICA_QUOTAS_MICROVERSION, "2.61") # noqa
def update(self, tenant_id, user_id=None, share_type=None, # noqa
shares=None, snapshots=None, gigabytes=None,
snapshot_gigabytes=None, share_networks=None,

View File

@ -608,13 +608,6 @@ def do_quota_defaults(cs, args):
default=None,
help='New value for the "replica_gigabytes" quota. Available only for '
'microversion >= 2.53')
@cliutils.arg(
'--force',
dest='force',
action="store_true",
default=None,
help='Whether force update the quota even if the already used '
'and reserved exceeds the new quota.')
@cliutils.arg(
'--per-share-gigabytes',
'--per_share_gigabytes',
@ -623,6 +616,13 @@ def do_quota_defaults(cs, args):
default=None,
help='New value for the "per_share_gigabytes" quota. Available only for '
'microversion >= 2.62')
@cliutils.arg(
'--force',
dest='force',
action="store_true",
default=None,
help='Whether force update the quota even if the already used '
'and reserved exceeds the new quota.')
@api_versions.wraps("1.0")
def do_quota_update(cs, args):
"""Update the quotas for a project/user and/or share type (Admin only)."""