Sort image list by name when launch instance

Just like the flavor sort issue, this is another regression issue
when we shift from the legacy launch instance wizard. By default,
the image list should be ordered by name.

Change-Id: Id619ad531f7e91326694ee90c112d6a7db0d14ad
(cherry picked from commit 71c4880429)
This commit is contained in:
Feilong Wang 2018-05-25 13:38:23 +12:00
parent b7d890bb3c
commit 7fe81e40c9
1 changed files with 2 additions and 1 deletions

View File

@ -558,7 +558,8 @@
var enabledSnapshot = allEnabled || !config.disable_instance_snapshot;
if (enabledImage || enabledSnapshot) {
return glanceAPI.getImages({status: 'active'}).then(function getEnabledImages(data) {
var filter = {status: 'active', sort_key: 'name', sort_dir: 'asc'};
return glanceAPI.getImages(filter).then(function getEnabledImages(data) {
if (enabledImage) {
onGetImages(data);
}