diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-02-23 22:04:17 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-02-23 22:04:17 +0000 |
| commit | 13a29b5a3263ae7c4249b3425c8ea3bf9801e578 (patch) | |
| tree | 93b9e33d4964ee3f700da42bbd3a570bd1a55b17 /cinderclient/v2/shell.py | |
| parent | 79750ab8ad1482ffc52e89b908a645f4c33d843a (diff) | |
| parent | c18f9073a48649a05cc3c389101aa0f94a121f0f (diff) | |
| download | python-cinderclient-13a29b5a3263ae7c4249b3425c8ea3bf9801e578.tar.gz | |
Merge "Fix sort problem in snapshot and backup list"
Diffstat (limited to 'cinderclient/v2/shell.py')
| -rw-r--r-- | cinderclient/v2/shell.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cinderclient/v2/shell.py b/cinderclient/v2/shell.py index b7b01d4..143d199 100644 --- a/cinderclient/v2/shell.py +++ b/cinderclient/v2/shell.py @@ -684,8 +684,14 @@ def do_snapshot_list(cs, args): limit=args.limit, sort=args.sort) _translate_volume_snapshot_keys(snapshots) + if args.sort: + sortby_index = None + else: + sortby_index = 0 + utils.print_list(snapshots, - ['ID', 'Volume ID', 'Status', 'Name', 'Size']) + ['ID', 'Volume ID', 'Status', 'Name', 'Size'], + sortby_index=sortby_index) @utils.arg('snapshot', @@ -1469,7 +1475,11 @@ def do_backup_list(cs, args): _translate_volume_snapshot_keys(backups) columns = ['ID', 'Volume ID', 'Status', 'Name', 'Size', 'Object Count', 'Container'] - utils.print_list(backups, columns) + if args.sort: + sortby_index = None + else: + sortby_index = 0 + utils.print_list(backups, columns, sortby_index=sortby_index) @utils.arg('backup', metavar='<backup>', nargs='+', |
