]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Python 3: fix test_ovs_tunnel
authorCyril Roelandt <cyril@redhat.com>
Tue, 4 Aug 2015 12:27:48 +0000 (14:27 +0200)
committerCyril Roelandt <cyril@redhat.com>
Tue, 4 Aug 2015 12:27:48 +0000 (14:27 +0200)
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

neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py
neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_tunnel.py

index 825670457071729277b585e5ab3460a8e0aaae34..c830f0005186da9fd7182f93f069803baac3e43a 100644 (file)
@@ -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,
index fadcfa8fc6e7a32cc85e2fc49c29b9b3765198d0..0f37d7395890e3b3829ecaf3442dbdd53a2006ea 100644 (file)
@@ -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(