summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/certs.py
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/install/certs.py
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/install/certs.py')
-rw-r--r--ipaserver/install/certs.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ipaserver/install/certs.py b/ipaserver/install/certs.py
index eebaa48c4..f0f0f1dfd 100644
--- a/ipaserver/install/certs.py
+++ b/ipaserver/install/certs.py
@@ -41,6 +41,7 @@ from ipapython import services as ipaservices
from ipalib import x509
from ipapython.dn import DN
from ipalib.errors import CertificateOperationError
+from ipalib.text import _
from nss.error import NSPRError
import nss.nss as nss
@@ -663,8 +664,9 @@ class CertDB(object):
dogtag.https_request(self.host_name, api.env.ca_ee_install_port, "/ca/ee/ca/profileSubmitSSLClient", self.secdir, password, "ipaCert", **params)
if http_status != 200:
- raise CertificateOperationError(error='Unable to communicate with CMS (%s)' % \
- http_reason_phrase)
+ raise CertificateOperationError(
+ error=_('Unable to communicate with CMS (%s)') %
+ http_reason_phrase)
# The result is an XML blob. Pull the certificate out of that
doc = xml.dom.minidom.parseString(http_body)