mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
LGTM: raise handle_not_found()
Turn calls "handle_not_found()" into "raise handle_not_found()" to indicate control flow chance. It makes the code easier to understand, the control flow more obvious and helps static analyzers. It's OK to raise here because handle_not_found() always raises an exception. https://pagure.io/freeipa/issue/7344 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
This commit is contained in:
@@ -227,7 +227,7 @@ class server_mod(LDAPUpdate):
|
||||
|
||||
if entry_attrs.get('ipalocation'):
|
||||
if not ldap.entry_exists(entry_attrs['ipalocation'][0]):
|
||||
self.api.Object.location.handle_not_found(
|
||||
raise self.api.Object.location.handle_not_found(
|
||||
options['ipalocation_location'])
|
||||
|
||||
if 'ipalocation' in entry_attrs or 'ipaserviceweight' in entry_attrs:
|
||||
@@ -893,7 +893,7 @@ class server_conncheck(crud.PKQuery):
|
||||
try:
|
||||
self.obj.get_dn_if_exists(*keys[:-1])
|
||||
except errors.NotFound:
|
||||
self.obj.handle_not_found(keys[-2])
|
||||
raise self.obj.handle_not_found(keys[-2])
|
||||
|
||||
# the user must have the Replication Administrators privilege
|
||||
privilege = u'Replication Administrators'
|
||||
|
||||
Reference in New Issue
Block a user