Merge "Update xrange and lambda for python3"

This commit is contained in:
Jenkins 2015-04-24 04:43:03 +00:00 committed by Gerrit Code Review
commit 8a3aac038b
5 changed files with 6 additions and 6 deletions

View File

@ -165,7 +165,7 @@ class StackController(object):
}
def replacecolon(d):
return dict(map(lambda (k, v): (k.replace(':', '.'), v),
return dict(map(lambda k_v: (k_v[0].replace(':', '.'), k_v[1]),
d.items()))
def transform(attrs):

View File

@ -181,7 +181,7 @@ class RandomString(resource.Resource):
for char_seq in char_sequences:
seq = char_seq[self.CHARACTER_SEQUENCES_SEQUENCE]
seq_min = char_seq[self.CHARACTER_SEQUENCES_MIN]
for i in xrange(seq_min):
for i in six.moves.xrange(seq_min):
random_string += random.choice(seq)
if char_classes:
@ -189,7 +189,7 @@ class RandomString(resource.Resource):
cclass_class = char_class[self.CHARACTER_CLASSES_CLASS]
cclass_seq = self._sequences[cclass_class]
cclass_min = char_class[self.CHARACTER_CLASSES_MIN]
for i in xrange(cclass_min):
for i in six.moves.xrange(cclass_min):
random_string += random.choice(cclass_seq)
def random_class_char():

View File

@ -428,7 +428,7 @@ class DependencyTaskGroup(object):
Iterate over all subtasks that are currently running - i.e. they have
been started but have not yet completed.
"""
running = lambda (k, r): k in self._graph and r.started()
running = lambda k_r: k_r[0] in self._graph and k_r[1].started()
return itertools.ifilter(running, six.iteritems(self._runners))

View File

@ -143,7 +143,7 @@ class KeystoneClientTest(common.HeatTestCase):
auth=mock_ks_auth)
c.AndReturn(self.mock_ks_v3_client)
for x in xrange(0, times):
for x in six.moves.xrange(0, times):
m = mock_ks_auth.get_access(mox.IsA(ks_session.Session))
m.AndReturn(mock_auth_ref)

View File

@ -381,7 +381,7 @@ class SwiftSignalTest(common.HeatTestCase):
time_now = timeutils.utcnow()
time_series = [datetime.timedelta(0, t) + time_now
for t in xrange(1, 100)]
for t in six.moves.xrange(1, 100)]
timeutils.set_time_override(time_series)
self.addCleanup(timeutils.clear_time_override)