Add --cn option to cert-status

Add the 'cacn' option to the cert-status command.  Right now there
is nothing we need to (or can) do with it, but we add it anyway for
future use.

Fixes: https://fedorahosted.org/freeipa/ticket/5999
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Fraser Tweedale 2016-07-01 14:42:37 +10:00 committed by Jan Cholasta
parent 2ec59b7f23
commit 4844eaec19
3 changed files with 12 additions and 11 deletions

View File

@ -799,9 +799,10 @@ output: Entry('result')
output: Output('summary', type=[<type 'unicode'>, <type 'NoneType'>])
output: PrimaryKey('value')
command: cert_status/1
args: 1,3,3
args: 1,4,3
arg: Int('request_id')
option: Flag('all', autofill=True, cli_name='all', default=False)
option: Str('cacn?', autofill=True, cli_name='ca', default=u'ipa')
option: Flag('raw', autofill=True, cli_name='raw', default=False)
option: Str('version?')
output: Entry('result')

View File

@ -90,5 +90,5 @@ IPA_DATA_VERSION=20100614120000
# #
########################################################
IPA_API_VERSION_MAJOR=2
IPA_API_VERSION_MINOR=209
# Last change: mbabinsk: Unify display of principal names/aliases across entities
IPA_API_VERSION_MINOR=210
# Last change: Add --ca option to cert-status

View File

@ -628,17 +628,17 @@ class cert_status(Retrieve, BaseCertMethod, VirtualCommand):
operation = "certificate status"
def get_options(self):
for option in super(cert_status, self).get_options():
if option.name == 'cacn':
# Dogtag requests are uniquely identified by their
# number; there is no need to distinguish by CA.
continue
yield option
def execute(self, request_id, **kw):
ca_enabled_check()
self.check_access()
# Dogtag requests are uniquely identified by their number;
# furthermore, Dogtag (as at v10.3.4) does not report the
# target CA in request data, so we cannot check. So for
# now, there is nothing we can do with the 'cacn' option
# but check if the specified CA exists.
self.api.Command.ca_show(kw['cacn'])
return dict(
result=self.Backend.ra.check_request_status(str(request_id)),
value=pkey_to_value(request_id, kw),