diff --git a/doc/source/command-objects/image.rst b/doc/source/command-objects/image.rst index 5184f44698..7fc33c697c 100644 --- a/doc/source/command-objects/image.rst +++ b/doc/source/command-objects/image.rst @@ -222,7 +222,7 @@ List available images .. option:: --sort [:] - 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 diff --git a/openstackclient/image/v1/image.py b/openstackclient/image/v1/image.py index 0d54e339e1..eb79cd2fed 100644 --- a/openstackclient/image/v1/image.py +++ b/openstackclient/image/v1/image.py @@ -353,8 +353,9 @@ class ListImage(command.Lister): parser.add_argument( '--sort', metavar="[:]", + 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 diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index 4031952bc4..054d16127a 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -450,8 +450,9 @@ class ListImage(command.Lister): parser.add_argument( '--sort', metavar="[:]", + 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( diff --git a/releasenotes/notes/bug-1639231-21823768bd54170a.yaml b/releasenotes/notes/bug-1639231-21823768bd54170a.yaml new file mode 100644 index 0000000000..740a0dd1b8 --- /dev/null +++ b/releasenotes/notes/bug-1639231-21823768bd54170a.yaml @@ -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 `_]