Merge "py3: use function next() instead of next() method on iterator objects"
This commit is contained in:
commit
200bb75250
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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, {})
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user