Replace SortedDict with OrderedDict

From django V1.9 django.utils.datastructures.SortedDict
will be removed and it is deprecated in V1.7.

The similar functionality is added in collections.OrderedDict
from python 2.7.

Horizon code also should avoid the SortedDict class and
start using the OrderedDict class.

This patch replacing the SortedDict with OrderedDict.

Change-Id: I8dfcf7c29fc49b6215451f160cf7a951bf11b5ad
Closes-Bug: #1492270
This commit is contained in:
Masco Kaliyamoorthy 2015-08-13 13:31:32 +05:30 committed by Matthias Runge
parent 6145532b53
commit 204eb8da88

@ -15,11 +15,11 @@
"""
Views for managing database instances.
"""
from collections import OrderedDict
import logging
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext_lazy as _
import six
@ -60,8 +60,8 @@ class IndexView(horizon_tables.DataTableView):
flavors = []
msg = _('Unable to retrieve database size information.')
exceptions.handle(self.request, msg)
return SortedDict((six.text_type(flavor.id), flavor)
for flavor in flavors)
return OrderedDict((six.text_type(flavor.id), flavor)
for flavor in flavors)
def _extra_data(self, instance):
flavor = self.get_flavors().get(instance.flavor["id"])