diff --git a/manila/api/v1/share_servers.py b/manila/api/v1/share_servers.py index adc8a1a090..d9faaa0217 100644 --- a/manila/api/v1/share_servers.py +++ b/manila/api/v1/share_servers.py @@ -93,7 +93,7 @@ class ShareServerController(wsgi.Controller): server.share_network_name = share_network['id'] except exception.ShareServerNotFound as e: raise exc.HTTPNotFound(explanation=e.msg) - except exception.ShareNetworkNotFound as e: + except exception.ShareNetworkNotFound: msg = _("Share server %s could not be found. Its associated " "share network does not " "exist.") % server.share_network_subnet['share_network_id'] diff --git a/manila/share/drivers/cephfs/driver.py b/manila/share/drivers/cephfs/driver.py index cc9ab40766..17880e8e3f 100644 --- a/manila/share/drivers/cephfs/driver.py +++ b/manila/share/drivers/cephfs/driver.py @@ -36,7 +36,7 @@ from manila.share import share_types try: import ceph_volume_client ceph_module_found = True -except ImportError as e: +except ImportError: ceph_volume_client = None ceph_module_found = False diff --git a/manila/share/drivers/generic.py b/manila/share/drivers/generic.py index e2bcd8f052..98cf1d5797 100644 --- a/manila/share/drivers/generic.py +++ b/manila/share/drivers/generic.py @@ -165,7 +165,7 @@ class GenericShareDriver(driver.ExecuteMixin, driver.ShareDriver): # (aovchinnikov): ssh_execute does not behave well when passed # parameters with spaces. - wrap = lambda token: "\"" + token + "\"" + wrap = lambda token: "\"" + token + "\"" # noqa: E731 command = [wrap(tkn) if tkn.count(' ') else tkn for tkn in command] return processutils.ssh_execute(ssh, ' '.join(command), check_exit_code=check_exit_code) @@ -304,7 +304,7 @@ class GenericShareDriver(driver.ExecuteMixin, driver.ShareDriver): try: # Remount it to avoid postponed point of failure self._ssh_exec(server_details, ['sudo', 'mount', '-a']) - except exception.ProcessExecutionError as e: + except exception.ProcessExecutionError: LOG.error("Failed to mount all shares on server '%s'.", server_details['instance_id']) diff --git a/manila/share/drivers/netapp/dataontap/cluster_mode/data_motion.py b/manila/share/drivers/netapp/dataontap/cluster_mode/data_motion.py index a77151dd94..27ac0d6314 100644 --- a/manila/share/drivers/netapp/dataontap/cluster_mode/data_motion.py +++ b/manila/share/drivers/netapp/dataontap/cluster_mode/data_motion.py @@ -190,7 +190,7 @@ class DataMotionSession(object): dest_vserver, dest_volume_name, clear_checkpoint=False) - except netapp_api.NaApiError as e: + except netapp_api.NaApiError: # Snapmirror is already deleted pass diff --git a/tox.ini b/tox.ini index 51142307c2..38cebe48c0 100644 --- a/tox.ini +++ b/tox.ini @@ -139,10 +139,9 @@ commands = alembic -c manila/db/migrations/alembic.ini revision -m ""{posargs} # E241 multiple spaces after ':' # E731 do not assign a lambda expression, use a def # E117 over-indented -# F841 local variable 'e' is assigned to but never used # E226 missing whitespace around arithmetic operator # F601 dictionary key 'qos' repeated with different values -ignore = E117,E123,E226,E241,E305,E402,E731,E741,F601,F841,W503,W504,W605 +ignore = E117,E123,E226,E241,E305,E402,E731,E741,F601,W503,W504,W605 builtins = _ # [H106] Don't put vim configuration in source files. # [H203] Use assertIs(Not)None to check for None.