Merge "Python 3: use dict.values instead of dict.itervalues"

This commit is contained in:
Jenkins 2015-06-16 08:52:50 +00:00 committed by Gerrit Code Review
commit 6fe424bfff
7 changed files with 9 additions and 9 deletions

View File

@ -411,7 +411,7 @@ class ExtensionManager(object):
resources = [] resources = []
resources.append(ResourceExtension('extensions', resources.append(ResourceExtension('extensions',
ExtensionController(self))) ExtensionController(self)))
for ext in self.extensions.itervalues(): for ext in self.extensions.values():
try: try:
resources.extend(ext.get_resources()) resources.extend(ext.get_resources())
except AttributeError: except AttributeError:
@ -423,7 +423,7 @@ class ExtensionManager(object):
def get_actions(self): def get_actions(self):
"""Returns a list of ActionExtension objects.""" """Returns a list of ActionExtension objects."""
actions = [] actions = []
for ext in self.extensions.itervalues(): for ext in self.extensions.values():
try: try:
actions.extend(ext.get_actions()) actions.extend(ext.get_actions())
except AttributeError: except AttributeError:
@ -435,7 +435,7 @@ class ExtensionManager(object):
def get_request_extensions(self): def get_request_extensions(self):
"""Returns a list of RequestExtension objects.""" """Returns a list of RequestExtension objects."""
request_exts = [] request_exts = []
for ext in self.extensions.itervalues(): for ext in self.extensions.values():
try: try:
request_exts.extend(ext.get_request_extensions()) request_exts.extend(ext.get_request_extensions())
except AttributeError: except AttributeError:

View File

@ -210,7 +210,7 @@ def parse_mappings(mapping_list, unique_values=True):
if key in mappings: if key in mappings:
raise ValueError(_("Key %(key)s in mapping: '%(mapping)s' not " raise ValueError(_("Key %(key)s in mapping: '%(mapping)s' not "
"unique") % {'key': key, 'mapping': mapping}) "unique") % {'key': key, 'mapping': mapping})
if unique_values and value in mappings.itervalues(): if unique_values and value in mappings.values():
raise ValueError(_("Value %(value)s in mapping: '%(mapping)s' " raise ValueError(_("Value %(value)s in mapping: '%(mapping)s' "
"not unique") % {'value': value, "not unique") % {'value': value,
'mapping': mapping}) 'mapping': mapping})

View File

@ -436,7 +436,7 @@ class LinuxBridgeManager(object):
self.delete_vxlan(interface) self.delete_vxlan(interface)
continue continue
for physical_interface in self.interface_mappings.itervalues(): for physical_interface in self.interface_mappings.values():
if (interface.startswith(physical_interface)): if (interface.startswith(physical_interface)):
ips, gateway = self.get_interface_details(bridge_name) ips, gateway = self.get_interface_details(bridge_name)
if ips: if ips:

View File

@ -146,7 +146,7 @@ class VlanTypeDriver(helpers.SegmentTypeDriver):
# remove from table unallocated vlans for any unconfigured # remove from table unallocated vlans for any unconfigured
# physical networks # physical networks
for allocs in allocations.itervalues(): for allocs in allocations.values():
for alloc in allocs: for alloc in allocs:
if not alloc.allocated: if not alloc.allocated:
LOG.debug("Removing vlan %(vlan_id)s on physical " LOG.debug("Removing vlan %(vlan_id)s on physical "

View File

@ -130,7 +130,7 @@ class EmbSwitch(object):
""" """
vf_list = [] vf_list = []
assigned_macs = [] assigned_macs = []
for vf_index in self.pci_slot_map.itervalues(): for vf_index in self.pci_slot_map.values():
if not PciOsWrapper.is_assigned_vf(self.dev_name, vf_index): if not PciOsWrapper.is_assigned_vf(self.dev_name, vf_index):
continue continue
vf_list.append(vf_index) vf_list.append(vf_index)

View File

@ -308,7 +308,7 @@ class SriovNicAgentConfigParser(object):
Validate that network_device in excluded_device Validate that network_device in excluded_device
exists in device mappings exists in device mappings
""" """
dev_net_set = set(self.device_mappings.itervalues()) dev_net_set = set(self.device_mappings.values())
for dev_name in self.exclude_devices.iterkeys(): for dev_name in self.exclude_devices.iterkeys():
if dev_name not in dev_net_set: if dev_name not in dev_net_set:
raise ValueError(_("Device name %(dev_name)s is missing from " raise ValueError(_("Device name %(dev_name)s is missing from "

View File

@ -369,7 +369,7 @@ class IsolatedCreds(cred_provider.CredentialProvider):
if not self.isolated_creds: if not self.isolated_creds:
return return
self._clear_isolated_net_resources() self._clear_isolated_net_resources()
for creds in self.isolated_creds.itervalues(): for creds in self.isolated_creds.values():
try: try:
self._delete_user(creds.user_id) self._delete_user(creds.user_id)
except lib_exc.NotFound: except lib_exc.NotFound: