summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ipalib/rpc.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ipalib/rpc.py b/ipalib/rpc.py
index 38be0c6c6..051d2c3de 100644
--- a/ipalib/rpc.py
+++ b/ipalib/rpc.py
@@ -196,7 +196,11 @@ class LanguageAwareTransport(Transport):
def get_host_info(self, host):
(host, extra_headers, x509) = Transport.get_host_info(self, host)
- lang = locale.setlocale(locale.LC_ALL, '').split('.')[0].lower()
+ try:
+ lang = locale.setlocale(locale.LC_ALL, '').split('.')[0].lower()
+ except locale.Error:
+ # fallback to default locale
+ lang = 'en_us'
if not isinstance(extra_headers, list):
extra_headers = []