diff --git a/swift/common/splice.py b/swift/common/splice.py index 7bc279c5dc..f5d81d8d10 100644 --- a/swift/common/splice.py +++ b/swift/common/splice.py @@ -86,7 +86,7 @@ class Tee(object): raise EnvironmentError('tee not available') if not isinstance(flags, six.integer_types): - c_flags = reduce(operator.or_, flags, 0) + c_flags = six.moves.reduce(operator.or_, flags, 0) else: c_flags = flags @@ -177,7 +177,7 @@ class Splice(object): raise EnvironmentError('splice not available') if not isinstance(flags, six.integer_types): - c_flags = reduce(operator.or_, flags, 0) + c_flags = six.moves.reduce(operator.or_, flags, 0) else: c_flags = flags diff --git a/swift/common/storage_policy.py b/swift/common/storage_policy.py index fcda344b56..415aa55377 100644 --- a/swift/common/storage_policy.py +++ b/swift/common/storage_policy.py @@ -15,6 +15,7 @@ from ConfigParser import ConfigParser import os import string import textwrap +import six from swift.common.utils import ( config_true_value, SWIFT_CONF_FILE, whataremyips) @@ -76,7 +77,8 @@ class BindPortsCache(object): # the first one we notice. # Return the requested set of ports from our (now-freshened) cache - return reduce(set.union, self.portsets_by_ring_path.values(), set()) + return six.moves.reduce(set.union, + self.portsets_by_ring_path.values(), set()) class PolicyError(ValueError): diff --git a/test/unit/common/test_internal_client.py b/test/unit/common/test_internal_client.py index 4b9c56d8ad..4c931af549 100644 --- a/test/unit/common/test_internal_client.py +++ b/test/unit/common/test_internal_client.py @@ -22,6 +22,7 @@ import zlib from textwrap import dedent import os +import six from six.moves import range from test.unit import FakeLogger import eventlet @@ -39,7 +40,7 @@ def not_sleep(seconds): def unicode_string(start, length): - return u''.join([unichr(x) for x in range(start, start + length)]) + return u''.join([six.unichr(x) for x in range(start, start + length)]) def path_parts():