mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
The PKI JSON API the revocation reason key may be case-sensitive
PKI 11.4.0 changed the reason keyword in the REST API from lower-case to camel-case in https://github.com/dogtagpki/pki/commit/926eb221ce6 Use Reason instead of reason as the keyword for revocations for PKI 11.4.0+ Related: https://pagure.io/freeipa/issue/9345 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Florence Blanc-Renaud <flo@redhat.com> Reviewed-By: Thomas Woerner <twoerner@redhat.com>
This commit is contained in:
parent
ed6fa6029d
commit
56a2bc5775
@ -274,6 +274,8 @@ if six.PY3:
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
pki_version = pki.util.Version(pki.specification_version())
|
||||
|
||||
# These are general status return values used when
|
||||
# CMSServlet.outputError() is invoked.
|
||||
CMS_SUCCESS = 0
|
||||
@ -1130,7 +1132,11 @@ class ra(rabase.rabase, RestClient):
|
||||
serial_number = int(serial_number, 0)
|
||||
|
||||
path = 'agent/certs/{}/revoke'.format(serial_number)
|
||||
data = '{{"reason":"{}"}}'.format(reasons[revocation_reason])
|
||||
if pki_version < pki.util.Version("11.4.0"):
|
||||
keyword = "reason"
|
||||
else:
|
||||
keyword = "Reason"
|
||||
data = '{{"{}":"{}"}}'.format(keyword, reasons[revocation_reason])
|
||||
|
||||
http_status, _http_headers, http_body = self._ssldo(
|
||||
'POST', path,
|
||||
|
Loading…
Reference in New Issue
Block a user