Python 3: fix glance.tests.functional.db.simple
We need to avoid comparing None to another type, as the comparison will be invalid on Python 3. Change-Id: I2beee405c17e2c6cdd6198b9d089e806a9c56c70
This commit is contained in:
parent
89a66916f8
commit
7e161ada97
|
@ -16,7 +16,6 @@
|
|||
|
||||
import copy
|
||||
import functools
|
||||
from operator import itemgetter
|
||||
import uuid
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
@ -382,7 +381,7 @@ def _sort_images(images, sort_key, sort_dir):
|
|||
|
||||
for key, dir in reversed(list(zip(sort_key, sort_dir))):
|
||||
reverse = dir == 'desc'
|
||||
images.sort(key=itemgetter(key), reverse=reverse)
|
||||
images.sort(key=lambda x: x[key] or '', reverse=reverse)
|
||||
|
||||
return images
|
||||
|
||||
|
|
5
tox.ini
5
tox.ini
|
@ -21,7 +21,10 @@ install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstac
|
|||
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
||||
|
||||
[testenv:py34]
|
||||
commands = lockutils-wrapper python setup.py testr --slowest --testr-args='glance.tests.unit'
|
||||
commands =
|
||||
lockutils-wrapper python setup.py testr --slowest --testr-args='glance.tests.unit'
|
||||
python -m testtools.run \
|
||||
glance.tests.functional.db.test_simple
|
||||
|
||||
[testenv:py34-constraints]
|
||||
install_command = {[testenv:common-constraints]install_command}
|
||||
|
|
Loading…
Reference in New Issue