From eb73a4fef576d6a3d74c41a5d6ff065f2b918553 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Thu, 5 Feb 2009 12:57:11 -0700 Subject: Renamed f_ra.py plugin to cert.py --- ipalib/plugins/cert.py | 117 +++++++++++++++++++++++++++++++++++++++++++++++++ ipalib/plugins/f_ra.py | 117 ------------------------------------------------- make-test | 2 +- 3 files changed, 118 insertions(+), 118 deletions(-) create mode 100644 ipalib/plugins/cert.py delete mode 100644 ipalib/plugins/f_ra.py diff --git a/ipalib/plugins/cert.py b/ipalib/plugins/cert.py new file mode 100644 index 00000000..6a5b3984 --- /dev/null +++ b/ipalib/plugins/cert.py @@ -0,0 +1,117 @@ +# Authors: +# Andrew Wnuk +# Jason Gerard DeRose +# +# Copyright (C) 2009 Red Hat +# see file 'COPYING' for use and warranty information +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; version 2 only +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +""" +Frontend plugins for IPA-RA PKI operations. +""" + +from ipalib import api, Command, Str, Int + + +class request_certificate(Command): + """ Submit a certificate request. """ + + takes_args = ['csr'] + + takes_options = [Str('request_type?', default=u'pkcs10')] + + def execute(self, csr, **options): + return self.Backend.ra.request_certificate(csr, **options) + + 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 submit a certificate request.') + +#api.register(request_certificate) + + +class get_certificate(Command): + """ Retrieve an existing certificate. """ + + takes_args = ['serial_number'] + + def execute(self, serial_number, **options): + 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 obtain a certificate.') + +#api.register(get_certificate) + + +class check_request_status(Command): + """ Check a request status. """ + + takes_args = ['request_id'] + + + 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 retrieve a request status.') + +#api.register(check_request_status) + + +class revoke_certificate(Command): + """ Revoke a certificate. """ + + takes_args = ['serial_number'] + + # FIXME: The default is 0. Is this really an Int param? + takes_options = [Int('revocation_reason?', default=0)] + + + def execute(self, serial_number, **options): + return self.Backend.ra.revoke_certificate(serial_number, **options) + + 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 revoke a certificate.') + +#api.register(revoke_certificate) + + +class take_certificate_off_hold(Command): + """ Take a revoked certificate off hold. """ + + takes_args = ['serial_number'] + + def execute(self, serial_number, **options): + return self.Backend.ra.take_certificate_off_hold(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 take a revoked certificate off hold.') + +#api.register(take_certificate_off_hold) diff --git a/ipalib/plugins/f_ra.py b/ipalib/plugins/f_ra.py deleted file mode 100644 index 6a5b3984..00000000 --- a/ipalib/plugins/f_ra.py +++ /dev/null @@ -1,117 +0,0 @@ -# Authors: -# Andrew Wnuk -# Jason Gerard DeRose -# -# Copyright (C) 2009 Red Hat -# see file 'COPYING' for use and warranty information -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; version 2 only -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -""" -Frontend plugins for IPA-RA PKI operations. -""" - -from ipalib import api, Command, Str, Int - - -class request_certificate(Command): - """ Submit a certificate request. """ - - takes_args = ['csr'] - - takes_options = [Str('request_type?', default=u'pkcs10')] - - def execute(self, csr, **options): - return self.Backend.ra.request_certificate(csr, **options) - - 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 submit a certificate request.') - -#api.register(request_certificate) - - -class get_certificate(Command): - """ Retrieve an existing certificate. """ - - takes_args = ['serial_number'] - - def execute(self, serial_number, **options): - 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 obtain a certificate.') - -#api.register(get_certificate) - - -class check_request_status(Command): - """ Check a request status. """ - - takes_args = ['request_id'] - - - 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 retrieve a request status.') - -#api.register(check_request_status) - - -class revoke_certificate(Command): - """ Revoke a certificate. """ - - takes_args = ['serial_number'] - - # FIXME: The default is 0. Is this really an Int param? - takes_options = [Int('revocation_reason?', default=0)] - - - def execute(self, serial_number, **options): - return self.Backend.ra.revoke_certificate(serial_number, **options) - - 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 revoke a certificate.') - -#api.register(revoke_certificate) - - -class take_certificate_off_hold(Command): - """ Take a revoked certificate off hold. """ - - takes_args = ['serial_number'] - - def execute(self, serial_number, **options): - return self.Backend.ra.take_certificate_off_hold(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 take a revoked certificate off hold.') - -#api.register(take_certificate_off_hold) diff --git a/make-test b/make-test index ee8470df..cfc1db6a 100755 --- a/make-test +++ b/make-test @@ -11,7 +11,7 @@ do if [[ -f $executable ]]; then echo "[ $name: Starting tests... ]" ((runs += 1)) - if $executable /usr/bin/nosetests -v --with-doctest + if $executable /usr/bin/nosetests -v #--with-doctest then echo "[ $name: Tests OK ]" else -- cgit