mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
schema cache: Fallback to 'en_us' when locale is not available
https://fedorahosted.org/freeipa/ticket/6204 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
committed by
Jan Cholasta
parent
44a2bdd8ea
commit
b6d5ed139b
@@ -371,9 +371,15 @@ class Schema(object):
|
||||
self._dict[ns] = {}
|
||||
self._namespaces[ns] = _SchemaNameSpace(self, ns)
|
||||
|
||||
self._language = (
|
||||
locale.setlocale(locale.LC_ALL, '').split('.')[0].lower()
|
||||
)
|
||||
# copy-paste from ipalib/rpc.py
|
||||
try:
|
||||
self._language = (
|
||||
locale.setlocale(locale.LC_ALL, '').split('.')[0].lower()
|
||||
)
|
||||
except locale.Error:
|
||||
# fallback to default locale
|
||||
self._language = 'en_us'
|
||||
|
||||
try:
|
||||
self._fingerprint = server_info['fingerprint']
|
||||
self._expiration = server_info['expiration']
|
||||
|
||||
Reference in New Issue
Block a user