Merge "sort snapshots in drop-down when launching instance"
This commit is contained in:
commit
fa3ed46fbd
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
import operator
|
||||||
|
|
||||||
from django.template.defaultfilters import filesizeformat # noqa
|
from django.template.defaultfilters import filesizeformat # noqa
|
||||||
from django.utils.text import normalize_newlines # noqa
|
from django.utils.text import normalize_newlines # noqa
|
||||||
@ -368,6 +369,7 @@ class SetInstanceDetailsAction(workflows.Action):
|
|||||||
for image in images
|
for image in images
|
||||||
if image.properties.get("image_type", '') == "snapshot"]
|
if image.properties.get("image_type", '') == "snapshot"]
|
||||||
if choices:
|
if choices:
|
||||||
|
choices.sort(key=operator.itemgetter(1))
|
||||||
choices.insert(0, ("", _("Select Instance Snapshot")))
|
choices.insert(0, ("", _("Select Instance Snapshot")))
|
||||||
else:
|
else:
|
||||||
choices.insert(0, ("", _("No snapshots available")))
|
choices.insert(0, ("", _("No snapshots available")))
|
||||||
|
Loading…
Reference in New Issue
Block a user