From: Cyril Roelandt Date: Wed, 5 Aug 2015 09:39:50 +0000 (+0200) Subject: Python 3: convert dict_keys object to list X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3adf970899950ebc88f2d0f5e34313d003973ea4;p=openstack-build%2Fneutron-build.git Python 3: convert dict_keys object to list This makes sure we use the same types in Python 2 and 3, prevents TypeErrors from happening, and should have no performance impact since the the lists are quite small anyway. Change-Id: I4e8563231a22a440b4f22b76b17f76f2ba45e606 Blueprint: neutron-python3 --- diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py index 7bcf39378..1e4dbaab9 100644 --- a/neutron/plugins/ml2/plugin.py +++ b/neutron/plugins/ml2/plugin.py @@ -1494,7 +1494,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2, port_ids_to_devices = dict( (self._device_to_port_id(context, device), device) for device in devices) - port_ids = port_ids_to_devices.keys() + port_ids = list(port_ids_to_devices.keys()) ports = db.get_ports_and_sgs(context, port_ids) for port in ports: # map back to original requested id