@@ -585,14 +585,20 @@ def get_parser(self, prog_name):
585585 parser .add_argument (
586586 'project' ,
587587 metavar = '<project/class>' ,
588- help = _ ('Set quotas for this project or class (name/ ID)' ),
588+ help = _ ('Set quotas for this project or class (name or ID)' ),
589589 )
590+ # TODO(stephenfin): Remove in OSC 8.0
590591 parser .add_argument (
591592 '--class' ,
592593 dest = 'quota_class' ,
593594 action = 'store_true' ,
594595 default = False ,
595- help = _ ('Set quotas for <class>' ),
596+ help = _ (
597+ '**Deprecated** Set quotas for <class>. '
598+ 'Deprecated as quota classes were never fully implemented '
599+ 'and only the default class is supported. '
600+ '(compute and volume only)'
601+ ),
596602 )
597603 for k , v , h in self ._build_options_list ():
598604 parser .add_argument (
@@ -624,6 +630,15 @@ def get_parser(self, prog_name):
624630 return parser
625631
626632 def take_action (self , parsed_args ):
633+ if parsed_args .quota_class :
634+ msg = _ (
635+ "The '--class' option has been deprecated. Quota classes were "
636+ "never fully implemented and the compute and volume services "
637+ "only support a single 'default' quota class while the "
638+ "network service does not support quota classes at all. "
639+ "Please use 'openstack quota show --default' instead."
640+ )
641+ self .log .warning (msg )
627642
628643 identity_client = self .app .client_manager .identity
629644 compute_client = self .app .client_manager .compute
@@ -718,12 +733,20 @@ def get_parser(self, prog_name):
718733 ),
719734 )
720735 type_group = parser .add_mutually_exclusive_group ()
736+ # TODO(stephenfin): Remove in OSC 8.0
721737 type_group .add_argument (
722738 '--class' ,
723739 dest = 'quota_class' ,
724740 action = 'store_true' ,
725741 default = False ,
726- help = _ ('Show quotas for <class>' ),
742+ help = _ (
743+ '**Deprecated** Show quotas for <class>. '
744+ 'Deprecated as quota classes were never fully implemented '
745+ 'and only the default class is supported. '
746+ 'Use --default instead which is also supported by the network '
747+ 'service. '
748+ '(compute and volume only)'
749+ ),
727750 )
728751 type_group .add_argument (
729752 '--default' ,
@@ -778,7 +801,16 @@ def get_parser(self, prog_name):
778801 def take_action (self , parsed_args ):
779802 project = parsed_args .project
780803
781- if not parsed_args .quota_class :
804+ if parsed_args .quota_class :
805+ msg = _ (
806+ "The '--class' option has been deprecated. Quota classes were "
807+ "never fully implemented and the compute and volume services "
808+ "only support a single 'default' quota class while the "
809+ "network service does not support quota classes at all. "
810+ "Please use 'openstack quota show --default' instead."
811+ )
812+ self .log .warning (msg )
813+ else :
782814 project_info = get_project (self .app , parsed_args .project )
783815 project = project_info ['id' ]
784816
0 commit comments