From: Cyril Roelandt Date: Fri, 19 Jun 2015 11:59:46 +0000 (+0200) Subject: Python3: use dict.keys() instead of dict.iterkeys() X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=870fb38b1c7ddd5ddb399e6ff13a4f7992f8f9a6;p=openstack-build%2Fneutron-build.git Python3: use dict.keys() instead of dict.iterkeys() The "keys" method works on both Python 2 and 3, and the performance impact should be negligible. Change-Id: I4771797859666000921e4e38cc5de72a8c084ca0 Blueprint: neutron-python3 --- diff --git a/neutron/extensions/quotasv2.py b/neutron/extensions/quotasv2.py index bddad4fe5..1055e92f4 100644 --- a/neutron/extensions/quotasv2.py +++ b/neutron/extensions/quotasv2.py @@ -48,7 +48,7 @@ class QuotaSetsController(wsgi.Controller): self._update_extended_attributes = True def _update_attributes(self): - for quota_resource in QUOTAS.resources.iterkeys(): + for quota_resource in QUOTAS.resources.keys(): attr_dict = EXTENDED_ATTRIBUTES_2_0[RESOURCE_COLLECTION] attr_dict[quota_resource] = { 'allow_post': False, diff --git a/neutron/plugins/sriovnicagent/sriov_nic_agent.py b/neutron/plugins/sriovnicagent/sriov_nic_agent.py index 9e3a928f5..24a54258d 100644 --- a/neutron/plugins/sriovnicagent/sriov_nic_agent.py +++ b/neutron/plugins/sriovnicagent/sriov_nic_agent.py @@ -309,7 +309,7 @@ class SriovNicAgentConfigParser(object): exists in device mappings """ dev_net_set = set(self.device_mappings.values()) - for dev_name in self.exclude_devices.iterkeys(): + for dev_name in self.exclude_devices.keys(): if dev_name not in dev_net_set: raise ValueError(_("Device name %(dev_name)s is missing from " "physical_device_mappings") % {'dev_name':