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:
parent
ce2e0d7425
commit
c37738ba6f
|
@ -330,6 +330,7 @@ class ListenersController(base.BaseController):
|
||||||
except odb_exceptions.DBError as e:
|
except odb_exceptions.DBError as e:
|
||||||
raise exceptions.InvalidOption(value=listener_dict.get('protocol'),
|
raise exceptions.InvalidOption(value=listener_dict.get('protocol'),
|
||||||
option='protocol') from e
|
option='protocol') from e
|
||||||
|
return None
|
||||||
|
|
||||||
@wsme_pecan.wsexpose(listener_types.ListenerRootResponse,
|
@wsme_pecan.wsexpose(listener_types.ListenerRootResponse,
|
||||||
body=listener_types.ListenerRootPOST, status_code=201)
|
body=listener_types.ListenerRootPOST, status_code=201)
|
||||||
|
|
|
@ -134,6 +134,7 @@ class MemberController(base.BaseController):
|
||||||
# before creation or update since the exception messages
|
# before creation or update since the exception messages
|
||||||
# do not give any information as to what constraint failed
|
# do not give any information as to what constraint failed
|
||||||
raise exceptions.InvalidOption(value='', option='') from e
|
raise exceptions.InvalidOption(value='', option='') from e
|
||||||
|
return None
|
||||||
|
|
||||||
def _validate_pool_id(self, member_id, db_member_pool_id):
|
def _validate_pool_id(self, member_id, db_member_pool_id):
|
||||||
if db_member_pool_id != self.pool_id:
|
if db_member_pool_id != self.pool_id:
|
||||||
|
|
|
@ -91,6 +91,7 @@ class BarbicanCertManager(cert_mgr.CertManager):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
LOG.error('Error storing certificate data: %s', str(e))
|
LOG.error('Error storing certificate data: %s', str(e))
|
||||||
|
return None
|
||||||
|
|
||||||
def get_cert(self, context, cert_ref, resource_ref=None, check_only=False,
|
def get_cert(self, context, cert_ref, resource_ref=None, check_only=False,
|
||||||
service_name=None):
|
service_name=None):
|
||||||
|
|
|
@ -114,6 +114,7 @@ class BarbicanCertManager(cert_mgr.CertManager):
|
||||||
i.name, old_ref)
|
i.name, old_ref)
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
LOG.error('Error storing certificate data: %s', str(e))
|
LOG.error('Error storing certificate data: %s', str(e))
|
||||||
|
return None
|
||||||
|
|
||||||
def get_cert(self, context, cert_ref, resource_ref=None, check_only=False,
|
def get_cert(self, context, cert_ref, resource_ref=None, check_only=False,
|
||||||
service_name=None):
|
service_name=None):
|
||||||
|
@ -158,6 +159,7 @@ class BarbicanCertManager(cert_mgr.CertManager):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
LOG.error('Error getting cert %s: %s', cert_ref, str(e))
|
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):
|
def delete_cert(self, context, cert_ref, resource_ref, service_name=None):
|
||||||
"""Deregister as a consumer for the specified cert.
|
"""Deregister as a consumer for the specified cert.
|
||||||
|
|
|
@ -118,6 +118,7 @@ class Policy(oslo_policy.Enforcer):
|
||||||
LOG.debug('Policy check for %(action)s failed with '
|
LOG.debug('Policy check for %(action)s failed with '
|
||||||
'credentials %(credentials)s',
|
'credentials %(credentials)s',
|
||||||
{'action': action, 'credentials': credentials})
|
{'action': action, 'credentials': credentials})
|
||||||
|
return None
|
||||||
|
|
||||||
def check_is_admin(self, context):
|
def check_is_admin(self, context):
|
||||||
"""Does roles contains 'admin' role according to policy setting.
|
"""Does roles contains 'admin' role according to policy setting.
|
||||||
|
|
|
@ -189,4 +189,5 @@ class exception_logger(object):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
self.logger(e)
|
self.logger(e)
|
||||||
|
return None
|
||||||
return call
|
return call
|
||||||
|
|
|
@ -264,3 +264,4 @@ class TaskUtils(object):
|
||||||
LOG.error("Failed to get loadbalancer %(loadbalancer)s "
|
LOG.error("Failed to get loadbalancer %(loadbalancer)s "
|
||||||
"due to: %(except)s",
|
"due to: %(except)s",
|
||||||
{'loadbalancer': loadbalancer_id, 'except': str(e)})
|
{'loadbalancer': loadbalancer_id, 'except': str(e)})
|
||||||
|
return None
|
||||||
|
|
|
@ -111,6 +111,7 @@ class ControllerWorker(base_taskflow.BaseTaskFlowEngine):
|
||||||
return create_amp_tf.storage.fetch('amphora')
|
return create_amp_tf.storage.fetch('amphora')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.error('Failed to create an amphora due to: %s', str(e))
|
LOG.error('Failed to create an amphora due to: %s', str(e))
|
||||||
|
return None
|
||||||
|
|
||||||
def delete_amphora(self, amphora_id):
|
def delete_amphora(self, amphora_id):
|
||||||
"""Deletes an existing Amphora.
|
"""Deletes an existing Amphora.
|
||||||
|
|
Loading…
Reference in New Issue