Sort list images by name by default

Set the default key and dir for openstack image list,
if no command line argument passed
Changing sort_key to name(old value: created_at)

Change-Id: I6c61f6e5a04824d655ccf43477afcec9652101df
Closes-Bug: #1639231
This commit is contained in:
Vijendra Soni 2016-11-11 20:01:05 +05:30
parent 95c26cebaa
commit a7a0d0c61a
4 changed files with 11 additions and 3 deletions

View File

@ -221,7 +221,7 @@ List available images
.. option:: --sort <key>[:<direction>]
Sort output by selected keys and directions(asc or desc) (default: asc),
Sort output by selected keys and directions(asc or desc) (default: name:asc),
multiple keys and directions can be specified separated by comma
.. option:: --limit <limit>

View File

@ -350,8 +350,9 @@ class ListImage(command.Lister):
parser.add_argument(
'--sort',
metavar="<key>[:<direction>]",
default='name:asc',
help=_("Sort output by selected keys and directions(asc or desc) "
"(default: asc), multiple keys and directions can be "
"(default: name:asc), multiple keys and directions can be "
"specified separated by comma"),
)
return parser

View File

@ -447,8 +447,9 @@ class ListImage(command.Lister):
parser.add_argument(
'--sort',
metavar="<key>[:<direction>]",
default='name:asc',
help=_("Sort output by selected keys and directions(asc or desc) "
"(default: asc), multiple keys and directions can be "
"(default: name:asc), multiple keys and directions can be "
"specified separated by comma"),
)
parser.add_argument(

View File

@ -0,0 +1,6 @@
---
features:
- |
The ``image list`` command will now sort by name in ascending order by
default. ``--sort`` option will have the default value of ``name:asc``.
[Bug `1639231 <https://bugs.launchpad.net/bugs/1639231>`_]