mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Catch ValueError when trying to retrieve existing credentials
get_credentials() was changed to raise ValueError instead of gssapi.exceptions.GSSError as part of the sweeper to clean up expired credentials caches. For WebUI users, this will prevent a 500 error if their associated credentials cache is expired or missing. https://pagure.io/freeipa/issue/8873 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
parent
d8b8f54bce
commit
51fb9d61bb
@ -175,7 +175,7 @@ def get_principal(ccache_name=None):
|
||||
try:
|
||||
creds = get_credentials(ccache_name=ccache_name)
|
||||
return unicode(creds.name)
|
||||
except gssapi.exceptions.GSSError as e:
|
||||
except ValueError as e:
|
||||
raise errors.CCacheError(message=unicode(e))
|
||||
|
||||
def get_credentials_if_valid(name=None, ccache_name=None):
|
||||
@ -202,5 +202,5 @@ def get_credentials_if_valid(name=None, ccache_name=None):
|
||||
return None
|
||||
except gssapi.exceptions.ExpiredCredentialsError:
|
||||
return None
|
||||
except gssapi.exceptions.GSSError:
|
||||
except ValueError:
|
||||
return None
|
||||
|
Loading…
Reference in New Issue
Block a user