Python 3: do not use itertools.izip

This no longer exists in Python 3. Use the zip function instead.

Blueprint: neutron-python3
Change-Id: Id7d33ec3d27a27f17040d28bead10f2eb3b831bb
This commit is contained in:
Cyril Roelandt 2015-06-23 15:28:34 +00:00
parent af41907e06
commit ad86291408
2 changed files with 3 additions and 8 deletions

View File

@ -14,7 +14,6 @@
# under the License.
import abc
import itertools
import random
from oslo_config import cfg
@ -328,8 +327,7 @@ class L3Scheduler(object):
chosen_agents):
port_bindings = plugin.get_ha_router_port_bindings(context,
[router_id])
for port_binding, agent in itertools.izip(port_bindings,
chosen_agents):
for port_binding, agent in zip(port_bindings, chosen_agents):
port_binding.l3_agent_id = agent.id
self.bind_router(context, router_id, agent)

View File

@ -13,8 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import itertools
import mock
from oslo_log import log as logging
import testtools
@ -53,9 +51,8 @@ class ExtNetDBTestCase(test_db_base_plugin_v2.NeutronDbPluginV2TestCase):
"""Override the routine for allowing the router:external attribute."""
# attributes containing a colon should be passed with
# a double underscore
new_args = dict(itertools.izip(map(lambda x: x.replace('__', ':'),
kwargs),
kwargs.values()))
new_args = dict(zip(map(lambda x: x.replace('__', ':'), kwargs),
kwargs.values()))
arg_list = new_args.pop('arg_list', ()) + (external_net.EXTERNAL,)
return super(ExtNetDBTestCase, self)._create_network(
fmt, name, admin_state_up, arg_list=arg_list, **new_args)