Merge "py3: use function next() instead of next() method on iterator objects"

This commit is contained in:
Jenkins 2015-01-20 12:03:42 +00:00 committed by Gerrit Code Review
commit 200bb75250
5 changed files with 13 additions and 12 deletions

View File

@ -734,7 +734,7 @@ class Resource(wsgi.Application):
try:
with ResourceExceptionHandler():
gen = ext(req=request, **action_args)
response = gen.next()
response = next(gen)
except Fault as ex:
response = ex

View File

@ -96,7 +96,7 @@ def parse_options_header(value):
return '', {}
parts = _tokenize(';' + value)
name = parts.next()[0]
name = next(parts)[0]
extra = dict(parts)
return name, extra

View File

@ -353,13 +353,13 @@ class IpRouteCommand(IpDeviceCommandBase):
'match', subnet).split('\n')
for subnet_route_line in subnet_route_list_lines:
i = iter(subnet_route_line.split())
while(i.next() != 'dev'):
while(next(i) != 'dev'):
pass
device = i.next()
device = next(i)
try:
while(i.next() != 'src'):
while(next(i) != 'src'):
pass
src = i.next()
src = next(i)
except Exception:
src = ''
if device != interface_name:

View File

@ -688,9 +688,9 @@ class ResourceTest(test.TestCase):
called.append(2)
ext1 = extension1(None)
ext1.next()
next(ext1)
ext2 = extension2(None)
ext2.next()
next(ext2)
response = resource.post_process_extensions([ext2, ext1],
None, None, {})
@ -718,9 +718,9 @@ class ResourceTest(test.TestCase):
yield 'foo'
ext1 = extension1(None)
ext1.next()
next(ext1)
ext2 = extension2(None)
ext2.next()
next(ext2)
response = resource.post_process_extensions([ext2, ext1],
None, None, {})

View File

@ -20,6 +20,7 @@ import os
import mock
from oslo.config import cfg
import six
from manila import context
from manila import exception
@ -859,8 +860,8 @@ class ServiceInstanceManagerTestCase(test.TestCase):
CONF.service_network_cidr)
fake_division_mask = CONF.service_network_division_mask
cidrs = serv_cidr.subnet(fake_division_mask)
cidr1 = str(cidrs.next())
cidr2 = str(cidrs.next())
cidr1 = six.text_type(next(cidrs))
cidr2 = six.text_type(next(cidrs))
self.stubs.Set(self._manager, '_get_all_service_subnets',
mock.Mock(return_value=[]))
result = self._manager._get_cidr_for_subnet()