summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2022-09-23 18:21:56 +0100
committerStephen Finucane <sfinucan@redhat.com>2022-09-30 12:40:18 +0100
commitb62021260c9c2d372ea635a2a7f0608b7c8472e1 (patch)
treebafe5d2df1a2bca1160eacf0dddc572dbd708612 /openstackclient
parent00e7019022585bc2be9aeb55eb40b1d04776ec22 (diff)
downloadpython-openstackclient-b62021260c9c2d372ea635a2a7f0608b7c8472e1.tar.gz
quota: Deprecate 'quota show --class', 'quota set --class' arguments
This doesn't do anything special in nova and cinder and is not supported in neutron. For the 'quota show' command, people should use the '--default' argument instead. Change-Id: I0dd38e5cb252a01d5817ed168be040b21b35e348 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/common/quota.py40
1 files changed, 36 insertions, 4 deletions
diff --git a/openstackclient/common/quota.py b/openstackclient/common/quota.py
index 0504b152..6739c51b 100644
--- a/openstackclient/common/quota.py
+++ b/openstackclient/common/quota.py
@@ -585,14 +585,20 @@ class SetQuota(common.NetDetectionMixin, command.Command):
parser.add_argument(
'project',
metavar='<project/class>',
- help=_('Set quotas for this project or class (name/ID)'),
+ help=_('Set quotas for this project or class (name or ID)'),
)
+ # TODO(stephenfin): Remove in OSC 8.0
parser.add_argument(
'--class',
dest='quota_class',
action='store_true',
default=False,
- help=_('Set quotas for <class>'),
+ help=_(
+ '**Deprecated** Set quotas for <class>. '
+ 'Deprecated as quota classes were never fully implemented '
+ 'and only the default class is supported. '
+ '(compute and volume only)'
+ ),
)
for k, v, h in self._build_options_list():
parser.add_argument(
@@ -624,6 +630,15 @@ class SetQuota(common.NetDetectionMixin, command.Command):
return parser
def take_action(self, parsed_args):
+ if parsed_args.quota_class:
+ msg = _(
+ "The '--class' option has been deprecated. Quota classes were "
+ "never fully implemented and the compute and volume services "
+ "only support a single 'default' quota class while the "
+ "network service does not support quota classes at all. "
+ "Please use 'openstack quota show --default' instead."
+ )
+ self.log.warning(msg)
identity_client = self.app.client_manager.identity
compute_client = self.app.client_manager.compute
@@ -718,12 +733,20 @@ class ShowQuota(command.Lister):
),
)
type_group = parser.add_mutually_exclusive_group()
+ # TODO(stephenfin): Remove in OSC 8.0
type_group.add_argument(
'--class',
dest='quota_class',
action='store_true',
default=False,
- help=_('Show quotas for <class>'),
+ help=_(
+ '**Deprecated** Show quotas for <class>. '
+ 'Deprecated as quota classes were never fully implemented '
+ 'and only the default class is supported. '
+ 'Use --default instead which is also supported by the network '
+ 'service. '
+ '(compute and volume only)'
+ ),
)
type_group.add_argument(
'--default',
@@ -778,7 +801,16 @@ class ShowQuota(command.Lister):
def take_action(self, parsed_args):
project = parsed_args.project
- if not parsed_args.quota_class:
+ if parsed_args.quota_class:
+ msg = _(
+ "The '--class' option has been deprecated. Quota classes were "
+ "never fully implemented and the compute and volume services "
+ "only support a single 'default' quota class while the "
+ "network service does not support quota classes at all. "
+ "Please use 'openstack quota show --default' instead."
+ )
+ self.log.warning(msg)
+ else:
project_info = get_project(self.app, parsed_args.project)
project = project_info['id']