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
This commit is contained in:
Andreas Jaeger 2020-04-01 08:56:27 +02:00
parent 8c1e23c275
commit aac6655997
5 changed files with 6 additions and 7 deletions

View File

@ -93,7 +93,7 @@ class ShareServerController(wsgi.Controller):
server.share_network_name = share_network['id'] server.share_network_name = share_network['id']
except exception.ShareServerNotFound as e: except exception.ShareServerNotFound as e:
raise exc.HTTPNotFound(explanation=e.msg) raise exc.HTTPNotFound(explanation=e.msg)
except exception.ShareNetworkNotFound as e: except exception.ShareNetworkNotFound:
msg = _("Share server %s could not be found. Its associated " msg = _("Share server %s could not be found. Its associated "
"share network does not " "share network does not "
"exist.") % server.share_network_subnet['share_network_id'] "exist.") % server.share_network_subnet['share_network_id']

View File

@ -36,7 +36,7 @@ from manila.share import share_types
try: try:
import ceph_volume_client import ceph_volume_client
ceph_module_found = True ceph_module_found = True
except ImportError as e: except ImportError:
ceph_volume_client = None ceph_volume_client = None
ceph_module_found = False ceph_module_found = False

View File

@ -165,7 +165,7 @@ class GenericShareDriver(driver.ExecuteMixin, driver.ShareDriver):
# (aovchinnikov): ssh_execute does not behave well when passed # (aovchinnikov): ssh_execute does not behave well when passed
# parameters with spaces. # 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] command = [wrap(tkn) if tkn.count(' ') else tkn for tkn in command]
return processutils.ssh_execute(ssh, ' '.join(command), return processutils.ssh_execute(ssh, ' '.join(command),
check_exit_code=check_exit_code) check_exit_code=check_exit_code)
@ -304,7 +304,7 @@ class GenericShareDriver(driver.ExecuteMixin, driver.ShareDriver):
try: try:
# Remount it to avoid postponed point of failure # Remount it to avoid postponed point of failure
self._ssh_exec(server_details, ['sudo', 'mount', '-a']) 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'.", LOG.error("Failed to mount all shares on server '%s'.",
server_details['instance_id']) server_details['instance_id'])

View File

@ -190,7 +190,7 @@ class DataMotionSession(object):
dest_vserver, dest_vserver,
dest_volume_name, dest_volume_name,
clear_checkpoint=False) clear_checkpoint=False)
except netapp_api.NaApiError as e: except netapp_api.NaApiError:
# Snapmirror is already deleted # Snapmirror is already deleted
pass pass

View File

@ -139,10 +139,9 @@ commands = alembic -c manila/db/migrations/alembic.ini revision -m ""{posargs}
# E241 multiple spaces after ':' # E241 multiple spaces after ':'
# E731 do not assign a lambda expression, use a def # E731 do not assign a lambda expression, use a def
# E117 over-indented # E117 over-indented
# F841 local variable 'e' is assigned to but never used
# E226 missing whitespace around arithmetic operator # E226 missing whitespace around arithmetic operator
# F601 dictionary key 'qos' repeated with different values # 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 = _ builtins = _
# [H106] Don't put vim configuration in source files. # [H106] Don't put vim configuration in source files.
# [H203] Use assertIs(Not)None to check for None. # [H203] Use assertIs(Not)None to check for None.