diff options
author | Rob Crittenden <rcritten@redhat.com> | 2010-12-10 10:53:20 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2010-12-13 09:58:26 -0500 |
commit | 5f8a9b9849ea81d0400d915dee055968d8c680e6 (patch) | |
tree | 82c89b477165a06b1905c4ae70cf272ba214c296 /ipalib/errors.py | |
parent | c9807f4b252055107118493b7d6b66309e3e0d27 (diff) | |
download | freeipa-5f8a9b9849ea81d0400d915dee055968d8c680e6.tar.gz freeipa-5f8a9b9849ea81d0400d915dee055968d8c680e6.tar.xz freeipa-5f8a9b9849ea81d0400d915dee055968d8c680e6.zip |
Add --out option to service, host and cert-show to save the cert to a file.
Override forward() to grab the result and if a certificate is in the entry
and the file is writable then dump the certificate in PEM format.
ticket 473
Diffstat (limited to 'ipalib/errors.py')
-rw-r--r-- | ipalib/errors.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ipalib/errors.py b/ipalib/errors.py index 8e119837e..f99a3a45a 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -1110,6 +1110,39 @@ class ManagedPolicyError(ExecutionError): errno = 4021 format = _('A managed group cannot have a password policy.') + +class FileError(ExecutionError): + """ + **4022** Errors when dealing with files + + For example: + + >>> raise FileError('cannot write file \'test\'') + Traceback (most recent call last): + ... + FileError: cannot write file 'test' + """ + + errno = 4022 + format = _('%(reason)s') + + +class NoCertificateError(ExecutionError): + """ + **4023** Raised when trying to retrieve a certificate that doesn't exist. + + For example: + + >>> raise NoCertificateError('\'ipa.example.com\' doesn't have a certificate.') + Traceback (most recent call last): + ... + NoCertificateError: 'ipa.example.com' doesn't have a certificate + """ + + errno = 4023 + format = _('\'%(entry)s\' doesn\'t have a certificate.') + + class ManagedGroupExistsError(ExecutionError): """ **4024** Raised when adding a user and its managed group exists |