diff options
Diffstat (limited to 'ipaclient/remote_plugins/schema.py')
-rw-r--r-- | ipaclient/remote_plugins/schema.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ipaclient/remote_plugins/schema.py b/ipaclient/remote_plugins/schema.py index ff7af6596..553da3512 100644 --- a/ipaclient/remote_plugins/schema.py +++ b/ipaclient/remote_plugins/schema.py @@ -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'] |