Use six.moves.reduce instead of builtin reduce

Builtin function 'reduce' in Python 2 has been moved to standard
library module in Python 3 [1]. To make code compatible, we should
replace reduce(expr) with six.moves.reduce(expr)

[1] http://python3porting.com/stdlib.html#moved-builtins

Change-Id: Idca3420918471c41548a871d043fafc983aa7ee6
Closes-Bug: #1530249
This commit is contained in:
houming-wang 2015-12-30 08:55:30 -05:00
parent 5372220afd
commit 9ae3d53a8d

View File

@ -22,6 +22,7 @@ import uuid
import mock
# NOTE(jokke): simplified transition to py3, behaves like py2 xrange
from six.moves import range
from six.moves import reduce
from glance.common import exception
from glance.common import timeutils