]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Python3: do not add dict_values objects
authorCyril Roelandt <cyril@redhat.com>
Fri, 3 Jul 2015 15:58:03 +0000 (15:58 +0000)
committerCyril Roelandt <cyril@redhat.com>
Mon, 6 Jul 2015 13:11:14 +0000 (15:11 +0200)
In Python 3, dict.values returns a dict_values object instead of a list.

Change-Id: I83bc7718ac9bbb64187fefae57ce835fbe225829
Blueprint: neutron-python3

neutron/tests/unit/db/test_db_base_plugin_v2.py

index adcfcb7ebf2120a1136046e847790b18f29ce443..6fef2cbbd8f21528faafeb9e605c705aa8240c61 100644 (file)
@@ -4110,8 +4110,10 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase):
                                             self.fmt)
                 res = self.deserialize(self.fmt, req.get_response(self.api))
                 self.assertEqual(len(res['subnet']['allocation_pools']), 2)
-                res_vals = res['subnet']['allocation_pools'][0].values() +\
-                    res['subnet']['allocation_pools'][1].values()
+                res_vals = (
+                    list(res['subnet']['allocation_pools'][0].values()) +
+                    list(res['subnet']['allocation_pools'][1].values())
+                )
                 for pool_val in ['10', '20', '30', '40']:
                     self.assertTrue('192.168.0.%s' % (pool_val) in res_vals)
                 if with_gateway_ip: