make_range function is fixed and properly tested
Fixes bug 1223293 Change-Id: I9c285be69cfa3e021cec418e5d794328b6066732
This commit is contained in:
@@ -52,6 +52,14 @@ def read_json_from_uri(uri):
|
||||
LOG.warn('Error while reading uri: %s' % e)
|
||||
|
||||
|
||||
def make_range(start, stop, step):
|
||||
last_full = stop - ((stop - start) % step)
|
||||
for i in xrange(start, last_full, step):
|
||||
yield xrange(i, i + step)
|
||||
if stop > last_full:
|
||||
yield xrange(last_full, stop)
|
||||
|
||||
|
||||
def store_user(runtime_storage_inst, user):
|
||||
runtime_storage_inst.set_by_key('user:%s' % user['user_id'], user)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user