Replace xrange() with six.moves.range()

xrange is no longer available in py3.
replacing xrange with range from six.moves

Change-Id: Ib863c316a0724bd9c4f53c2e5a8d1bcd42c4dc5a
This commit is contained in:
janonymous 2015-07-03 00:45:58 +05:30
parent 170313d7db
commit 8eca02d3a1

View File

@ -20,7 +20,7 @@ from cStringIO import StringIO
from optparse import OptionParser
from sys import exit, stdout
from time import time
from six.moves import range
from eventlet import GreenPool, patcher, sleep
from eventlet.pools import Pool
@ -162,7 +162,7 @@ Usage: %%prog [options] [conf_file]
if container_populate:
container_ring = Ring(swift_dir, ring_name='container')
parts_left = dict((x, x)
for x in xrange(container_ring.partition_count))
for x in range(container_ring.partition_count))
if options.no_overlap:
with connpool.item() as conn:
@ -214,7 +214,7 @@ Usage: %%prog [options] [conf_file]
container = 'dispersion_objects_%d' % policy.idx
put_container(connpool, container, None, headers)
object_ring = Ring(swift_dir, ring_name=policy.ring_name)
parts_left = dict((x, x) for x in xrange(object_ring.partition_count))
parts_left = dict((x, x) for x in range(object_ring.partition_count))
if options.no_overlap:
with connpool.item() as conn: