summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.pylintrc1
-rw-r--r--cinder/quota.py4
-rw-r--r--cinder/scheduler/host_manager.py2
-rw-r--r--cinder/test.py2
-rw-r--r--cinder/utils.py2
-rw-r--r--cinder/volume/drivers/dell_emc/sc/storagecenter_api.py2
-rw-r--r--cinder/volume/drivers/huawei/huawei_driver.py2
-rw-r--r--cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py2
-rw-r--r--cinder/volume/drivers/netapp/dataontap/client/api.py4
-rw-r--r--cinder/volume/drivers/nexenta/ns5/iscsi.py2
-rw-r--r--cinder/volume/drivers/prophetstor/dpl_fc.py6
-rw-r--r--cinder/volume/drivers/quobyte.py2
-rw-r--r--cinder/volume/drivers/remotefs.py2
-rw-r--r--cinder/volume/drivers/tintri.py2
14 files changed, 17 insertions, 18 deletions
diff --git a/.pylintrc b/.pylintrc
index d65eb6dd1..63359a3ca 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -148,7 +148,6 @@ disable=
unidiomatic-typecheck,
consider-using-enumerate,
bad-whitespace,
- consider-iterating-dictionary,
line-too-long,
useless-super-delegation,
pointless-string-statement,
diff --git a/cinder/quota.py b/cinder/quota.py
index 00982643a..77155109a 100644
--- a/cinder/quota.py
+++ b/cinder/quota.py
@@ -484,7 +484,7 @@ class NestedDbQuotaDriver(DbQuotaDriver):
ctxt, resources, cur_proj_id)
# Validate each resource when compared to it's child quotas
- for resource in cur_project_quotas.keys():
+ for resource in cur_project_quotas:
parent_quota = cur_project_quotas[resource]
parent_limit = parent_quota['limit']
parent_usage = (parent_quota['in_use'] +
@@ -619,7 +619,7 @@ class NestedDbQuotaDriver(DbQuotaDriver):
context, resources, project_id)
# All defaults are 0 for child project
if quota_utils.get_parent_project_id(context, project_id):
- for key in defaults.keys():
+ for key in defaults:
defaults[key] = 0
return defaults
diff --git a/cinder/scheduler/host_manager.py b/cinder/scheduler/host_manager.py
index 144a1f294..725707623 100644
--- a/cinder/scheduler/host_manager.py
+++ b/cinder/scheduler/host_manager.py
@@ -840,7 +840,7 @@ class HostManager(object):
for old_pool in old_pools:
oldpools[old_pool['pool_name']] = old_pool
- for key in newpools.keys():
+ for key in newpools:
if key in oldpools.keys():
for k in self.REQUIRED_KEYS:
if newpools[key][k] != oldpools[key][k]:
diff --git a/cinder/test.py b/cinder/test.py
index 85fb55832..78480307e 100644
--- a/cinder/test.py
+++ b/cinder/test.py
@@ -341,7 +341,7 @@ class TestCase(testtools.TestCase):
# Delete attributes that don't start with _ so they don't pin
# memory around unnecessarily for the duration of the test
# suite
- for key in [k for k in self.__dict__.keys() if k[0] != '_']:
+ for key in [k for k in self.__dict__ if k[0] != '_']:
del self.__dict__[key]
def override_config(self, name, override, group=None):
diff --git a/cinder/utils.py b/cinder/utils.py
index cd537bc9a..829b1f055 100644
--- a/cinder/utils.py
+++ b/cinder/utils.py
@@ -113,7 +113,7 @@ def check_exclusive_options(**kwargs):
#
# Ex: 'the_key' -> 'the key'
if pretty_keys:
- names = [k.replace('_', ' ') for k in kwargs.keys()]
+ names = [k.replace('_', ' ') for k in kwargs]
else:
names = kwargs.keys()
names = ", ".join(sorted(names))
diff --git a/cinder/volume/drivers/dell_emc/sc/storagecenter_api.py b/cinder/volume/drivers/dell_emc/sc/storagecenter_api.py
index d639db6c9..a453b2960 100644
--- a/cinder/volume/drivers/dell_emc/sc/storagecenter_api.py
+++ b/cinder/volume/drivers/dell_emc/sc/storagecenter_api.py
@@ -1723,7 +1723,7 @@ class SCApi(object):
# Return the response in lowercase
wwns_lower = [w.lower() for w in wwns]
itmap_lower = dict()
- for key in itmap.keys():
+ for key in itmap:
itmap_lower[key.lower()] = [v.lower() for v in itmap[key]]
return lun, wwns_lower, itmap_lower
diff --git a/cinder/volume/drivers/huawei/huawei_driver.py b/cinder/volume/drivers/huawei/huawei_driver.py
index de6b6b1da..7e880cb49 100644
--- a/cinder/volume/drivers/huawei/huawei_driver.py
+++ b/cinder/volume/drivers/huawei/huawei_driver.py
@@ -684,7 +684,7 @@ class HuaweiBaseDriver(driver.VolumeDriver):
self.configuration.lun_write_cache_policy),
'OWNINGCONTROLLER': lun_info['OWNINGCONTROLLER'], }
- for item in lun_params.keys():
+ for item in lun_params:
if lun_params.get(item) == '--':
del lun_params[item]
diff --git a/cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py b/cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py
index 0aeedb774..f72d3177a 100644
--- a/cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py
+++ b/cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py
@@ -1602,7 +1602,7 @@ class XIVProxy(proxy.IBMStorageProxy):
self.meta['stat']['rpo'] = repl.Replication.get_supported_rpo()
self.meta['stat']['replication_count'] = len(self.targets)
self.meta['stat']['replication_targets'] = [target for target in
- self.targets.keys()]
+ self.targets]
self.meta['stat']['timestamp'] = datetime.datetime.utcnow()
diff --git a/cinder/volume/drivers/netapp/dataontap/client/api.py b/cinder/volume/drivers/netapp/dataontap/client/api.py
index 7f1c96c00..4e530dd2e 100644
--- a/cinder/volume/drivers/netapp/dataontap/client/api.py
+++ b/cinder/volume/drivers/netapp/dataontap/client/api.py
@@ -340,7 +340,7 @@ class NaElement(object):
def add_attrs(self, **attrs):
"""Add multiple attributes to the element."""
- for attr in attrs.keys():
+ for attr in attrs:
self._element.set(attr, attrs.get(attr))
def add_child_elem(self, na_element):
@@ -405,7 +405,7 @@ class NaElement(object):
def create_node_with_children(node, **children):
"""Creates and returns named node with children."""
parent = NaElement(node)
- for child in children.keys():
+ for child in children:
parent.add_new_child(child, children.get(child, None))
return parent
diff --git a/cinder/volume/drivers/nexenta/ns5/iscsi.py b/cinder/volume/drivers/nexenta/ns5/iscsi.py
index 84ebf05a7..d205614ac 100644
--- a/cinder/volume/drivers/nexenta/ns5/iscsi.py
+++ b/cinder/volume/drivers/nexenta/ns5/iscsi.py
@@ -322,7 +322,7 @@ class NexentaISCSIDriver(driver.ISCSIDriver):
else:
# Choose the best target group among existing ones
tg_name = None
- for tg in self.volumes.keys():
+ for tg in self.volumes:
if len(self.volumes[tg]) < 20:
tg_name = tg
break
diff --git a/cinder/volume/drivers/prophetstor/dpl_fc.py b/cinder/volume/drivers/prophetstor/dpl_fc.py
index 2e6c74ba2..14824117a 100644
--- a/cinder/volume/drivers/prophetstor/dpl_fc.py
+++ b/cinder/volume/drivers/prophetstor/dpl_fc.py
@@ -250,8 +250,8 @@ class DPLFCDriver(dplcommon.DPLCOMMONDriver,
'target.')
raise exception.VolumeBackendAPIException(data=msg)
- for keyFc in dc_fc.keys():
- for targetuuid in dc_target.keys():
+ for keyFc in dc_fc:
+ for targetuuid in dc_target:
if dc_fc[keyFc]['hardware_address'] == \
dc_target[targetuuid]['targetAddr']:
preferTargets[targetuuid] = dc_target[targetuuid]
@@ -267,7 +267,7 @@ class DPLFCDriver(dplcommon.DPLCOMMONDriver,
szwwpns.append(szwwpn)
if len(szwwpns):
- for targetUuid in preferTargets.keys():
+ for targetUuid in preferTargets:
targetWwpn = ''
targetWwpn = preferTargets.get(targetUuid,
{}).get('targetAddr', '')
diff --git a/cinder/volume/drivers/quobyte.py b/cinder/volume/drivers/quobyte.py
index cb7ceceaf..ace03951b 100644
--- a/cinder/volume/drivers/quobyte.py
+++ b/cinder/volume/drivers/quobyte.py
@@ -598,7 +598,7 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed):
self._load_shares_config()
- for share in self.shares.keys():
+ for share in self.shares:
try:
self._ensure_share_mounted(share)
self._mounted_shares.append(share)
diff --git a/cinder/volume/drivers/remotefs.py b/cinder/volume/drivers/remotefs.py
index cc1d507c0..ad9da0c76 100644
--- a/cinder/volume/drivers/remotefs.py
+++ b/cinder/volume/drivers/remotefs.py
@@ -317,7 +317,7 @@ class RemoteFSDriver(driver.BaseVD):
self.driver_prefix +
'_shares_config'))
- for share in self.shares.keys():
+ for share in self.shares:
try:
self._ensure_share_mounted(share)
mounted_shares.append(share)
diff --git a/cinder/volume/drivers/tintri.py b/cinder/volume/drivers/tintri.py
index 979f7f75d..3f6d10142 100644
--- a/cinder/volume/drivers/tintri.py
+++ b/cinder/volume/drivers/tintri.py
@@ -800,7 +800,7 @@ class TintriDriver(driver.ManageableVD,
mounted_image_shares = []
if self._image_shares_config:
self._load_shares_config(self._image_shares_config)
- for share in self.shares.keys():
+ for share in self.shares:
try:
self._ensure_share_mounted(share)
mounted_image_shares.append(share)