]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Python 3: convert dict_keys object to list
authorCyril Roelandt <cyril@redhat.com>
Wed, 5 Aug 2015 09:39:50 +0000 (11:39 +0200)
committerCyril Roelandt <cyril@redhat.com>
Wed, 5 Aug 2015 09:47:19 +0000 (11:47 +0200)
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

neutron/plugins/ml2/plugin.py

index 7bcf39378ecca8f23d430d6de85a0d17a976516b..1e4dbaab96745c9e88f285c4dc53616f8c92a475 100644 (file)
@@ -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