Browse Source

Hacking: Fix F841

Fix:
F841 local variable 'e' is assigned to but never used

Also, fix other problems found by hacking in these files.

Change-Id: Ib6eaf27c8e6f1414acc9dbde41a35bd412b7161e
changes/10/716510/2
Andreas Jaeger 2 years ago
parent
commit
aac6655997
  1. 2
      manila/api/v1/share_servers.py
  2. 2
      manila/share/drivers/cephfs/driver.py
  3. 4
      manila/share/drivers/generic.py
  4. 2
      manila/share/drivers/netapp/dataontap/cluster_mode/data_motion.py
  5. 3
      tox.ini

2
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']

2
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

4
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'])

2
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

3
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.

Loading…
Cancel
Save