Fix pep8 errors

pylint 2.7.0 added additional checks for inconsistent-return-statements:
- inconsistent-return-statements message is now emitted if one of
  try/except statement is not returning explicitly while the other do.

Change-Id: I196e13996ce4bce93d9a8eed87f6c3cb8ef3cea1
This commit is contained in:
Gregory Thiemonge 2021-02-22 11:51:44 +01:00
parent ce2e0d7425
commit c37738ba6f
8 changed files with 9 additions and 0 deletions

View File

@ -330,6 +330,7 @@ class ListenersController(base.BaseController):
except odb_exceptions.DBError as e:
raise exceptions.InvalidOption(value=listener_dict.get('protocol'),
option='protocol') from e
return None
@wsme_pecan.wsexpose(listener_types.ListenerRootResponse,
body=listener_types.ListenerRootPOST, status_code=201)

View File

@ -134,6 +134,7 @@ class MemberController(base.BaseController):
# before creation or update since the exception messages
# do not give any information as to what constraint failed
raise exceptions.InvalidOption(value='', option='') from e
return None
def _validate_pool_id(self, member_id, db_member_pool_id):
if db_member_pool_id != self.pool_id:

View File

@ -91,6 +91,7 @@ class BarbicanCertManager(cert_mgr.CertManager):
except Exception as e:
with excutils.save_and_reraise_exception():
LOG.error('Error storing certificate data: %s', str(e))
return None
def get_cert(self, context, cert_ref, resource_ref=None, check_only=False,
service_name=None):

View File

@ -114,6 +114,7 @@ class BarbicanCertManager(cert_mgr.CertManager):
i.name, old_ref)
with excutils.save_and_reraise_exception():
LOG.error('Error storing certificate data: %s', str(e))
return None
def get_cert(self, context, cert_ref, resource_ref=None, check_only=False,
service_name=None):
@ -158,6 +159,7 @@ class BarbicanCertManager(cert_mgr.CertManager):
except Exception as e:
with excutils.save_and_reraise_exception():
LOG.error('Error getting cert %s: %s', cert_ref, str(e))
return None
def delete_cert(self, context, cert_ref, resource_ref, service_name=None):
"""Deregister as a consumer for the specified cert.

View File

@ -118,6 +118,7 @@ class Policy(oslo_policy.Enforcer):
LOG.debug('Policy check for %(action)s failed with '
'credentials %(credentials)s',
{'action': action, 'credentials': credentials})
return None
def check_is_admin(self, context):
"""Does roles contains 'admin' role according to policy setting.

View File

@ -189,4 +189,5 @@ class exception_logger(object):
except Exception as e:
with excutils.save_and_reraise_exception():
self.logger(e)
return None
return call

View File

@ -264,3 +264,4 @@ class TaskUtils(object):
LOG.error("Failed to get loadbalancer %(loadbalancer)s "
"due to: %(except)s",
{'loadbalancer': loadbalancer_id, 'except': str(e)})
return None

View File

@ -111,6 +111,7 @@ class ControllerWorker(base_taskflow.BaseTaskFlowEngine):
return create_amp_tf.storage.fetch('amphora')
except Exception as e:
LOG.error('Failed to create an amphora due to: %s', str(e))
return None
def delete_amphora(self, amphora_id):
"""Deletes an existing Amphora.