From 35984181197680f711798bc004889c8a37a86aaa Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 13 Jun 2014 13:34:46 -0400 Subject: [PATCH] sort snapshots in drop-down when launching instance Closes-Bug: #1329949 Change-Id: I6e20406b2e6f0dd6248233333bccf932d0350b92 --- .../dashboards/project/instances/workflows/create_instance.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py b/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py index ca5f6fbb0c..332e892290 100644 --- a/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py +++ b/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py @@ -18,6 +18,7 @@ import json import logging +import operator from django.template.defaultfilters import filesizeformat # noqa from django.utils.text import normalize_newlines # noqa @@ -368,6 +369,7 @@ class SetInstanceDetailsAction(workflows.Action): for image in images if image.properties.get("image_type", '') == "snapshot"] if choices: + choices.sort(key=operator.itemgetter(1)) choices.insert(0, ("", _("Select Instance Snapshot"))) else: choices.insert(0, ("", _("No snapshots available")))