@@ -323,14 +323,6 @@ def do_get_pools(cs, args):
323323 'Use the show command to see which fields are available. '
324324 'Unavailable/non-existent fields will be ignored. '
325325 'Default=None.' )
326- @utils .arg ('--sort_key' ,
327- metavar = '<sort_key>' ,
328- default = None ,
329- help = argparse .SUPPRESS )
330- @utils .arg ('--sort_dir' ,
331- metavar = '<sort_dir>' ,
332- default = None ,
333- help = argparse .SUPPRESS )
334326@utils .arg ('--sort' ,
335327 metavar = '<key>[:<direction>]' ,
336328 default = None ,
@@ -397,24 +389,15 @@ def do_list(cs, args):
397389 for field_title in args .fields .split (',' ):
398390 field_titles .append (field_title )
399391
400- # --sort_key and --sort_dir deprecated in kilo and is not supported
401- # with --sort
402- if args .sort and (args .sort_key or args .sort_dir ):
403- raise exceptions .CommandError (
404- 'The --sort_key and --sort_dir arguments are deprecated and are '
405- 'not supported with --sort.' )
406-
407392 total_count = 0
408393 if show_count :
409394 search_opts ['with_count' ] = args .with_count
410395 volumes , total_count = cs .volumes .list (
411396 search_opts = search_opts , marker = args .marker ,
412- limit = args .limit , sort_key = args .sort_key ,
413- sort_dir = args .sort_dir , sort = args .sort )
397+ limit = args .limit , sort = args .sort )
414398 else :
415399 volumes = cs .volumes .list (search_opts = search_opts , marker = args .marker ,
416- limit = args .limit , sort_key = args .sort_key ,
417- sort_dir = args .sort_dir , sort = args .sort )
400+ limit = args .limit , sort = args .sort )
418401 shell_utils .translate_volume_keys (volumes )
419402
420403 # Create a list of servers to which the volume is attached
@@ -450,7 +433,7 @@ def do_list(cs, args):
450433 if search_opts ['all_tenants' ]:
451434 key_list .insert (1 , 'Tenant ID' )
452435
453- if args .sort_key or args . sort_dir or args . sort :
436+ if args .sort :
454437 sortby_index = None
455438 else :
456439 sortby_index = 0
@@ -2563,25 +2546,13 @@ def do_transfer_list(cs, args):
25632546 }
25642547
25652548 sort = getattr (args , 'sort' , None )
2566- sort_key = None
2567- sort_dir = None
25682549 if sort :
2569- # We added this feature with sort_key and sort_dir, but that was a
2570- # mistake as we've deprecated that construct a long time ago and should
2571- # be removing it in favor of --sort. Too late for the service side, but
2572- # to make the client experience consistent, we handle the compatibility
2573- # here.
25742550 sort_args = sort .split (':' )
25752551 if len (sort_args ) > 2 :
25762552 raise exceptions .CommandError (
25772553 'Invalid sort parameter provided. Argument must be in the '
25782554 'form "key[:<asc|desc>]".' )
25792555
2580- sort_key = sort_args [0 ]
2581- if len (sort_args ) == 2 :
2582- sort_dir = sort_args [1 ]
2583-
2584- transfers = cs .transfers .list (
2585- search_opts = search_opts , sort_key = sort_key , sort_dir = sort_dir )
2556+ transfers = cs .transfers .list (search_opts = search_opts , sort = sort )
25862557 columns = ['ID' , 'Volume ID' , 'Name' ]
25872558 utils .print_list (transfers , columns )
0 commit comments