From ad86291408fc74827c2bd31f89a2dce34f887823 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Tue, 23 Jun 2015 15:28:34 +0000 Subject: [PATCH] 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 --- neutron/scheduler/l3_agent_scheduler.py | 4 +--- neutron/tests/unit/extensions/test_external_net.py | 7 ++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/neutron/scheduler/l3_agent_scheduler.py b/neutron/scheduler/l3_agent_scheduler.py index e23501d4f..4d20ba7b8 100644 --- a/neutron/scheduler/l3_agent_scheduler.py +++ b/neutron/scheduler/l3_agent_scheduler.py @@ -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) diff --git a/neutron/tests/unit/extensions/test_external_net.py b/neutron/tests/unit/extensions/test_external_net.py index 0f68cae38..bd4d57302 100644 --- a/neutron/tests/unit/extensions/test_external_net.py +++ b/neutron/tests/unit/extensions/test_external_net.py @@ -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) -- 2.45.2