mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Define errors_by_code in ipalib.errors
The errors_by_code mapping could be used in more places. In particular it will be useful in the Dogtag GSS-API authentication effort. Move to ipalib.errors. Part of: https://pagure.io/freeipa/issue/5011 Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
parent
cc624fb178
commit
c7766ebb94
@ -2016,5 +2016,7 @@ class GenericError(PublicError):
|
||||
public_errors = tuple(sorted(
|
||||
messages.iter_messages(globals(), PublicError), key=lambda E: E.errno))
|
||||
|
||||
errors_by_code = dict((e.errno, e) for e in public_errors)
|
||||
|
||||
if __name__ == '__main__':
|
||||
messages.print_report('public errors', public_errors)
|
||||
|
@ -52,7 +52,7 @@ import six
|
||||
|
||||
from ipalib.backend import Connectible
|
||||
from ipalib.constants import LDAP_GENERALIZED_TIME_FORMAT
|
||||
from ipalib.errors import (public_errors, UnknownError, NetworkError,
|
||||
from ipalib.errors import (errors_by_code, UnknownError, NetworkError,
|
||||
XMLRPCMarshallError, JSONError)
|
||||
from ipalib import errors, capabilities
|
||||
from ipalib.request import context, Connection
|
||||
@ -97,8 +97,6 @@ logger = logging.getLogger(__name__)
|
||||
COOKIE_NAME = 'ipa_session'
|
||||
CCACHE_COOKIE_KEY = 'X-IPA-Session-Cookie'
|
||||
|
||||
errors_by_code = dict((e.errno, e) for e in public_errors)
|
||||
|
||||
|
||||
def update_persistent_client_session_data(principal, data):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user