Replace xrange in for loop with range
xrange is not supported in python 3, so replace it with six.moves.range Change-Id: I9356d176d2c848880fbc6e94509b4fee91a68481 Closes-Bug: #1261984
This commit is contained in:
parent
39b5b0bb2f
commit
c440cef08a
|
@ -22,6 +22,7 @@ import os
|
|||
import random
|
||||
import string
|
||||
|
||||
from six import moves
|
||||
import sqlalchemy
|
||||
|
||||
from openstack.common.db import exception as exc
|
||||
|
@ -34,7 +35,7 @@ def _gen_credentials(*names):
|
|||
"""Generate credentials."""
|
||||
auth_dict = {}
|
||||
for name in names:
|
||||
val = ''.join(random.choice(string.lowercase) for i in xrange(10))
|
||||
val = ''.join(random.choice(string.lowercase) for i in moves.range(10))
|
||||
auth_dict[name] = val
|
||||
return auth_dict
|
||||
|
||||
|
|
Loading…
Reference in New Issue