diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2009-02-05 15:30:58 -0700 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-02-17 16:03:08 -0500 |
commit | d9d5e8b2d572c5e2393bdd79f198057277c467ca (patch) | |
tree | 12fdf334f7d9a815e283ebf221bd7728d684b74e | |
parent | eb73a4fef576d6a3d74c41a5d6ff065f2b918553 (diff) | |
download | freeipa-d9d5e8b2d572c5e2393bdd79f198057277c467ca.tar.gz freeipa-d9d5e8b2d572c5e2393bdd79f198057277c467ca.tar.xz freeipa-d9d5e8b2d572c5e2393bdd79f198057277c467ca.zip |
Some cleanup in cert plugins module, changed to shorter command names all starting with cert_*
-rw-r--r-- | ipalib/plugins/cert.py | 66 |
1 files changed, 39 insertions, 27 deletions
diff --git a/ipalib/plugins/cert.py b/ipalib/plugins/cert.py index 6a5b3984c..c900e9437 100644 --- a/ipalib/plugins/cert.py +++ b/ipalib/plugins/cert.py @@ -19,18 +19,22 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -Frontend plugins for IPA-RA PKI operations. +Command plugins for IPA-RA certificate operations. """ from ipalib import api, Command, Str, Int -class request_certificate(Command): - """ Submit a certificate request. """ +class cert_request(Command): + """ + Submit a certificate singing request. + """ - takes_args = ['csr'] + takes_args = ('csr',) - takes_options = [Str('request_type?', default=u'pkcs10')] + takes_options = ( + Str('request_type?', default=u'pkcs10', autofill=True), + ) def execute(self, csr, **options): return self.Backend.ra.request_certificate(csr, **options) @@ -41,46 +45,52 @@ class request_certificate(Command): else: textui.print_plain('Failed to submit a certificate request.') -#api.register(request_certificate) +api.register(cert_request) -class get_certificate(Command): - """ Retrieve an existing certificate. """ +class cert_status(Command): + """ + Check status of a certificate signing request. + """ - takes_args = ['serial_number'] + takes_args = ['request_id'] - def execute(self, serial_number, **options): - return self.Backend.ra.get_certificate(serial_number) + + def execute(self, request_id, **options): + return self.Backend.ra.check_request_status(request_id) def output_for_cli(self, textui, result, *args, **options): if isinstance(result, dict) and len(result) > 0: textui.print_entry(result, 0) else: - textui.print_plain('Failed to obtain a certificate.') - -#api.register(get_certificate) + textui.print_plain('Failed to retrieve a request status.') +api.register(cert_status) -class check_request_status(Command): - """ Check a request status. """ - takes_args = ['request_id'] +class cert_get(Command): + """ + Retrieve an existing certificate. + """ + takes_args = ['serial_number'] - def execute(self, request_id, **options): - return self.Backend.ra.check_request_status(request_id) + def execute(self, serial_number): + return self.Backend.ra.get_certificate(serial_number) def output_for_cli(self, textui, result, *args, **options): if isinstance(result, dict) and len(result) > 0: textui.print_entry(result, 0) else: - textui.print_plain('Failed to retrieve a request status.') + textui.print_plain('Failed to obtain a certificate.') -#api.register(check_request_status) +api.register(cert_get) -class revoke_certificate(Command): - """ Revoke a certificate. """ +class cert_revoke(Command): + """ + Revoke a certificate. + """ takes_args = ['serial_number'] @@ -97,11 +107,13 @@ class revoke_certificate(Command): else: textui.print_plain('Failed to revoke a certificate.') -#api.register(revoke_certificate) +api.register(cert_revoke) -class take_certificate_off_hold(Command): - """ Take a revoked certificate off hold. """ +class cert_remove_hold(Command): + """ + Take a revoked certificate off hold. + """ takes_args = ['serial_number'] @@ -114,4 +126,4 @@ class take_certificate_off_hold(Command): else: textui.print_plain('Failed to take a revoked certificate off hold.') -#api.register(take_certificate_off_hold) +api.register(cert_remove_hold) |