summaryrefslogtreecommitdiffstats
path: root/ipapython/dogtag.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 /ipapython/dogtag.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 'ipapython/dogtag.py')
-rw-r--r--ipapython/dogtag.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/ipapython/dogtag.py b/ipapython/dogtag.py
index df569c448..8298ecfef 100644
--- a/ipapython/dogtag.py
+++ b/ipapython/dogtag.py
@@ -17,15 +17,17 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-from ipalib import api, errors
import httplib
import xml.dom.minidom
-from ipapython import nsslib, ipautil
import nss.nss as nss
from nss.error import NSPRError
-from ipalib.errors import NetworkError, CertificateOperationError
from urllib import urlencode
+
+from ipalib import api, errors
+from ipapython import nsslib, ipautil
+from ipalib.errors import NetworkError, CertificateOperationError
from ipapython.ipa_log_manager import *
+from ipalib.text import _
def get_ca_certchain(ca_host=None):
"""
@@ -52,12 +54,14 @@ def get_ca_certchain(ca_host=None):
reason = item_node[0].childNodes[0].data
raise errors.RemoteRetrieveError(reason=reason)
except Exception, e:
- raise errors.RemoteRetrieveError(reason="Retrieving CA cert chain failed: %s" % str(e))
+ raise errors.RemoteRetrieveError(
+ reason=_("Retrieving CA cert chain failed: %s") % e)
finally:
if doc:
doc.unlink()
else:
- raise errors.RemoteRetrieveError(reason="request failed with HTTP status %d" % res.status)
+ raise errors.RemoteRetrieveError(
+ reason=_("request failed with HTTP status %d") % res.status)
return chain