summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2012-07-04 08:52:47 -0400
committerMartin Kosek <mkosek@redhat.com>2012-09-03 18:16:12 +0200
commita95eaeac8e07b8ccd173b0f408575cc9a0d508fc (patch)
tree6cd7e09e02d313a3d382d1efbb27588aab27a866 /ipaserver/plugins
parent4f03aed5e603389bbb149464eee597180470ad70 (diff)
downloadfreeipa-a95eaeac8e07b8ccd173b0f408575cc9a0d508fc.tar.gz
freeipa-a95eaeac8e07b8ccd173b0f408575cc9a0d508fc.tar.xz
freeipa-a95eaeac8e07b8ccd173b0f408575cc9a0d508fc.zip
Internationalization for public errors
Currently, we throw many public exceptions without proper i18n. Wrap natural-language error messages in _() so they can be translated. In the service plugin, raise NotFound errors using handle_not_found helper so the error message contains the offending service. Use ScriptError instead of NotFoundError in bindinstance install. https://fedorahosted.org/freeipa/ticket/1953
Diffstat (limited to 'ipaserver/plugins')
-rw-r--r--ipaserver/plugins/join.py2
-rw-r--r--ipaserver/plugins/selfsign.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/ipaserver/plugins/join.py b/ipaserver/plugins/join.py
index e7713dc06..6ea02b2e1 100644
--- a/ipaserver/plugins/join.py
+++ b/ipaserver/plugins/join.py
@@ -106,7 +106,7 @@ class join(Command):
# It exists, can we write the password attributes?
allowed = ldap.can_write(dn, 'krblastpwdchange')
if not allowed:
- raise errors.ACIError(info="Insufficient 'write' privilege to the 'krbLastPwdChange' attribute of entry '%s'." % dn)
+ raise errors.ACIError(info=_("Insufficient 'write' privilege to the 'krbLastPwdChange' attribute of entry '%s'.") % dn)
kw = {'fqdn': hostname, 'all': True}
attrs_list = api.Command['host_show'](**kw)['result']
diff --git a/ipaserver/plugins/selfsign.py b/ipaserver/plugins/selfsign.py
index bd79f7186..8118d88c5 100644
--- a/ipaserver/plugins/selfsign.py
+++ b/ipaserver/plugins/selfsign.py
@@ -208,7 +208,8 @@ class ra(rabase.rabase):
serial = x509.get_serial_number(cert)
except NSPRError, e:
self.log.error('Unable to decode certificate in entry: %s' % str(e))
- raise errors.CertificateOperationError(error='Unable to decode certificate in entry: %s' % str(e))
+ raise errors.CertificateOperationError(
+ error=_('Unable to decode certificate in entry: %s') % str(e))
# To make it look like dogtag return just the base64 data.
cert = cert.replace('\n','')