Sort flavors with operator.itemgetter('ram')
The current syntax is not python3 compatible, so we look to shade to help accomplish our sorting syntax. Change-Id: Iadb39f976840fd2af6e0bd7b08bd3b01169e37a1 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
4a611a53ce
commit
71ff1a9bc5
|
@ -18,6 +18,7 @@
|
|||
|
||||
import logging
|
||||
from contextlib import contextmanager
|
||||
import operator
|
||||
|
||||
import shade
|
||||
|
||||
|
@ -129,7 +130,7 @@ class ProviderManager(object):
|
|||
|
||||
def _getFlavors(self):
|
||||
flavors = self.listFlavors()
|
||||
flavors.sort(lambda a, b: cmp(a['ram'], b['ram']))
|
||||
flavors.sort(key=operator.itemgetter('ram'))
|
||||
return flavors
|
||||
|
||||
# TODO(mordred): These next three methods duplicate logic that is in
|
||||
|
|
Loading…
Reference in New Issue