From 59531d9d11c3e7aed7f41f85dd48ef8567b82e37 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Tue, 4 Aug 2015 14:27:48 +0200 Subject: [PATCH] Python 3: fix test_ovs_tunnel In Python 3, this happens: >>> d = {} >>> a = d.values() >>> b = d.values() >>> a == b False And anyway we're not really willing to pass dict_values objects around; we are expecting lists, just like in Python 2, so let's just do the conversion. Change-Id: I62ef32d50ba5ce64a653ffc62ba18c53cab9b15c Blueprint: neutron-python3 --- .../plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py | 2 +- .../plugins/ml2/drivers/openvswitch/agent/test_ovs_tunnel.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py b/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py index 82567045707..c830f000518 100644 --- a/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py +++ b/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py @@ -596,7 +596,7 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin, if network_type in constants.TUNNEL_NETWORK_TYPES: if self.enable_tunneling: # outbound broadcast/multicast - ofports = self.tun_br_ofports[network_type].values() + ofports = list(self.tun_br_ofports[network_type].values()) if ofports: self.tun_br.install_flood_to_tun(lvid, segmentation_id, diff --git a/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_tunnel.py b/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_tunnel.py index fadcfa8fc6e..0f37d739589 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_tunnel.py +++ b/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_tunnel.py @@ -294,7 +294,7 @@ class TunnelTest(object): self._verify_mock_calls() def test_provision_local_vlan(self): - ofports = TUN_OFPORTS[p_const.TYPE_GRE].values() + ofports = list(TUN_OFPORTS[p_const.TYPE_GRE].values()) self.mock_tun_bridge_expected += [ mock.call.install_flood_to_tun(LV_ID, LS_ID, ofports), mock.call.provision_local_vlan(