From 969d65945e6492695d1d5df1f9318e61cc06316e Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Mon, 8 Jun 2020 17:51:57 -0400 Subject: [PATCH] bump pycodestyle to 2.6.0 Fixes E225, E741 failures Change-Id: I0cb196012a35097709bd421361e0721e71e8c307 --- cinder/api/contrib/services.py | 2 +- .../tests/unit/volume/drivers/ibm/test_storwize_svc.py | 2 +- .../unit/volume/drivers/inspur/instorage/fakes.py | 2 +- .../unit/volume/drivers/solidfire/test_solidfire.py | 2 +- cinder/volume/drivers/dell_emc/vnx/client.py | 2 +- .../drivers/ibm/storwize_svc/storwize_svc_common.py | 2 +- cinder/volume/drivers/kaminario/kaminario_common.py | 10 +++++----- .../drivers/netapp/dataontap/utils/data_motion.py | 2 +- cinder/volume/drivers/quobyte.py | 4 ++-- cinder/volume/drivers/solidfire.py | 2 +- lower-constraints.txt | 2 +- test-requirements.txt | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cinder/api/contrib/services.py b/cinder/api/contrib/services.py index 02180ba4c72..db9b717e819 100644 --- a/cinder/api/contrib/services.py +++ b/cinder/api/contrib/services.py @@ -213,7 +213,7 @@ class ServiceController(wsgi.Controller): log_req) result.append({'host': service.host, 'binary': service.binary, - 'levels': {l.prefix: l.level for l in levels}}) + 'levels': {le.prefix: le.level for le in levels}}) return {'log_levels': result} diff --git a/cinder/tests/unit/volume/drivers/ibm/test_storwize_svc.py b/cinder/tests/unit/volume/drivers/ibm/test_storwize_svc.py index 5cf2229cd24..31e9c3d4053 100644 --- a/cinder/tests/unit/volume/drivers/ibm/test_storwize_svc.py +++ b/cinder/tests/unit/volume/drivers/ibm/test_storwize_svc.py @@ -2676,7 +2676,7 @@ port_speed!N/A if peer_sys not in self._partnership_list: return self._errors['CMMVC5753E'] - partner_state = ('fully_configured' if 'start'in kwargs + partner_state = ('fully_configured' if 'start' in kwargs else 'fully_configured_stopped') self._partnership_list[peer_sys]['partnership'] = partner_state return('', '') diff --git a/cinder/tests/unit/volume/drivers/inspur/instorage/fakes.py b/cinder/tests/unit/volume/drivers/inspur/instorage/fakes.py index 46f32fc3655..92c9e52b88e 100644 --- a/cinder/tests/unit/volume/drivers/inspur/instorage/fakes.py +++ b/cinder/tests/unit/volume/drivers/inspur/instorage/fakes.py @@ -2168,7 +2168,7 @@ port_speed!N/A if peer_sys not in self._partnership_list: return self._errors['CMMVC5753E'] - partner_state = ('fully_configured' if 'start'in kwargs + partner_state = ('fully_configured' if 'start' in kwargs else 'fully_configured_stopped') self._partnership_list[peer_sys]['partnership'] = partner_state return('', '') diff --git a/cinder/tests/unit/volume/drivers/solidfire/test_solidfire.py b/cinder/tests/unit/volume/drivers/solidfire/test_solidfire.py index f460b218adb..3e4c3e545f1 100644 --- a/cinder/tests/unit/volume/drivers/solidfire/test_solidfire.py +++ b/cinder/tests/unit/volume/drivers/solidfire/test_solidfire.py @@ -1852,7 +1852,7 @@ class SolidFireVolumeTestCase(test.TestCase): def _fake_issue_api_req(method, params, version=0): if 'ListActiveVolumes' in method: return {'result': {'volumes': sf_vols}} - if 'ListSnapshots'in method: + if 'ListSnapshots' in method: return {'result': {'snapshots': sf_snaps}} with mock.patch.object(sfv, '_issue_api_request', diff --git a/cinder/volume/drivers/dell_emc/vnx/client.py b/cinder/volume/drivers/dell_emc/vnx/client.py index 86e82fd3604..35c73f9056c 100644 --- a/cinder/volume/drivers/dell_emc/vnx/client.py +++ b/cinder/volume/drivers/dell_emc/vnx/client.py @@ -545,7 +545,7 @@ class Client(object): self.vnx.remove_hba(initiator_uid) def update_consistencygroup(self, cg, lun_ids_to_add, lun_ids_to_remove): - lun_ids_in_cg = (set([l.lun_id for l in cg.lun_list]) if cg.lun_list + lun_ids_in_cg = (set([lu.lun_id for lu in cg.lun_list]) if cg.lun_list else set()) # lun_ids_to_add and lun_ids_to_remove never overlap. diff --git a/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py b/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py index 4ec9deca2d0..d22b33345f7 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py +++ b/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py @@ -5074,7 +5074,7 @@ class StorwizeSVCCommonDriver(san.SanDriver, {'resp_len': len(resp), 'mirror_pool': opts['mirror_pool']}) raise exception.ManageExistingVolumeTypeMismatch(reason=msg) - if (opts['mirror_pool']and opts['mirror_pool'] != + if (opts['mirror_pool'] and opts['mirror_pool'] != copies['secondary']['mdisk_grp_name']): msg = (_("Failed to manage existing volume due to mirror pool " "mismatch. The secondary pool of the volume to be " diff --git a/cinder/volume/drivers/kaminario/kaminario_common.py b/cinder/volume/drivers/kaminario/kaminario_common.py index 7fe418350d0..05e70e06622 100644 --- a/cinder/volume/drivers/kaminario/kaminario_common.py +++ b/cinder/volume/drivers/kaminario/kaminario_common.py @@ -520,10 +520,10 @@ class KaminarioCinderDriver(cinder.volume.driver.ISCSIDriver): def _is_user_snap_sync_finished(self): # waiting for user snapshot to be synced while len(self.snap_updates) > 0: - for l in self.snap_updates: - sess = l.get('tgt_ssn') - gno = l.get('gno') - stime = l.get('stime') + for update in self.snap_updates: + sess = update.get('tgt_ssn') + gno = update.get('gno') + stime = update.get('stime') sess.refresh() if (sess.generation_number == gno and sess.current_snapshot_progress == 100 @@ -535,7 +535,7 @@ class KaminarioCinderDriver(cinder.volume.driver.ISCSIDriver): self.snap_updates.append({'tgt_ssn': sess, 'gno': gen_no, 'stime': time.time()}) - self.snap_updates.remove(l) + self.snap_updates.remove(update) eventlet.sleep(1) @utils.trace diff --git a/cinder/volume/drivers/netapp/dataontap/utils/data_motion.py b/cinder/volume/drivers/netapp/dataontap/utils/data_motion.py index d158d046d8a..52d5c55b6fd 100644 --- a/cinder/volume/drivers/netapp/dataontap/utils/data_motion.py +++ b/cinder/volume/drivers/netapp/dataontap/utils/data_motion.py @@ -555,7 +555,7 @@ class DataMotionMixin(object): given replication target. """ filtered_mirrors = [x for x in mirrors - if x.get('destination-volume')in flexvols] + if x.get('destination-volume') in flexvols] sorted_mirrors = sorted(filtered_mirrors, key=lambda x: int(x.get('lag-time')), reverse=True) diff --git a/cinder/volume/drivers/quobyte.py b/cinder/volume/drivers/quobyte.py index 2ad8b4c3878..1ffc0630e09 100644 --- a/cinder/volume/drivers/quobyte.py +++ b/cinder/volume/drivers/quobyte.py @@ -657,8 +657,8 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed): """Mount Quobyte volume to mount path.""" mounted = False with QuobyteDriver.read_proc_mount() as proc_mount: - for l in proc_mount: - if l.split()[1] == mount_path: + for line in proc_mount: + if line.split()[1] == mount_path: mounted = True break diff --git a/cinder/volume/drivers/solidfire.py b/cinder/volume/drivers/solidfire.py index f35f54dbcc1..6a83c5c2a30 100644 --- a/cinder/volume/drivers/solidfire.py +++ b/cinder/volume/drivers/solidfire.py @@ -1333,7 +1333,7 @@ class SolidFireDriver(san.SanISCSIDriver): def _retrieve_qos_setting(self, volume, extended_size=0): qos = {} if (self.configuration.sf_allow_tenant_qos and - volume.get('volume_metadata')is not None): + volume.get('volume_metadata') is not None): qos = self._set_qos_presets(volume) ctxt = context.get_admin_context() diff --git a/lower-constraints.txt b/lower-constraints.txt index d3cadd60797..b984c1b8a39 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -97,7 +97,7 @@ psycopg2==2.7 pyasn1-modules==0.2.1 pyasn1==0.4.2 pycadf==2.7.0 -pycodestyle==2.5.0 +pycodestyle==2.6.0 pycparser==2.19 pyflakes==0.8.1 Pygments==2.2.0 diff --git a/test-requirements.txt b/test-requirements.txt index 5c94b00d00e..bc40285e9f8 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -12,7 +12,7 @@ coverage!=4.4,>=4.1 # Apache-2.0 ddt>=1.2.1 # MIT fixtures>=3.0.0 # Apache-2.0/BSD oslotest>=3.2.0 # Apache-2.0 -pycodestyle==2.5.0 # MIT License +pycodestyle==2.6.0 # MIT License PyMySQL>=0.7.6 # MIT License psycopg2>=2.7 # LGPL/ZPL SQLAlchemy-Utils>=0.36.1 # BSD License