cert: add revocation reason back to cert-find output

In commit c718ef0588 some param values were
accidentally removed from cert-find output.

In commit 22d5f579bb `serial_number_hex` and
`revoked` were added back.

Add back `revocation_reason` as well. Also, do not include `revoked` with
--raw, as it's a virtual attribute.

https://fedorahosted.org/freeipa/ticket/6269

Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
This commit is contained in:
Jan Cholasta 2016-10-12 12:58:46 +02:00 committed by Martin Basti
parent 6c09d6f878
commit 16dad1c3cb

View File

@ -1231,16 +1231,17 @@ class cert_find(Search, CertMethod):
obj = {'serial_number': serial_number}
else:
obj = ra_obj
obj['issuer'] = issuer
obj['subject'] = DN(ra_obj['subject'])
obj['revoked'] = (
ra_obj['status'] in (u'REVOKED', u'REVOKED_EXPIRED'))
if all:
ra_obj = ra.get_certificate(str(serial_number))
if not raw:
obj.update(ra.get_certificate(str(serial_number)))
if not raw:
obj['issuer'] = issuer
obj['subject'] = DN(ra_obj['subject'])
obj['revoked'] = (
ra_obj['status'] in (u'REVOKED', u'REVOKED_EXPIRED'))
if all:
obj['certificate'] = (
ra_obj['certificate'].replace('\r\n', ''))
obj['certificate'].replace('\r\n', ''))
self.obj._parse(obj)
obj['cacn'] = ca_obj['cn'][0]