When revoking a certificate passing in an empty revocation reason caused an Internal Error. It already sets a default so making it required prevents empty values and it still operates the same way.

rob
>From 669879148bd0c98911327661007e18906dd5499d Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcrit...@redhat.com>
Date: Wed, 4 Apr 2012 14:57:22 -0400
Subject: [PATCH] Make revocation_reason required when revoking a certificate.

This will prevent errors if an empty reason is provided and it is
set by default one doesn't have to always set it on the command-line.

https://fedorahosted.org/freeipa/ticket/2597
---
 API.txt                |    2 +-
 VERSION                |    2 +-
 ipalib/plugins/cert.py |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/API.txt b/API.txt
index 1464bc60f1bf08ed5b2f0ee5213a721ab1e95382..c2b17942f7aeaf64715343b51c95b25c6c4099d3 100644
--- a/API.txt
+++ b/API.txt
@@ -433,7 +433,7 @@ output: Output('result', <type 'dict'>, None)
 command: cert_revoke
 args: 1,1,1
 arg: Str('serial_number')
-option: Int('revocation_reason?', autofill=True, default=0, maxvalue=10, minvalue=0)
+option: Int('revocation_reason', autofill=True, default=0, maxvalue=10, minvalue=0)
 output: Output('result', None, None)
 command: cert_show
 args: 1,1,1
diff --git a/VERSION b/VERSION
index e15d463ba5c8ad10e2fe7bc7b4fcaf83c00ac8a8..dd8cfbb4ae3cf0d238448a4e48d94c5724fba2c3 100644
--- a/VERSION
+++ b/VERSION
@@ -79,4 +79,4 @@ IPA_DATA_VERSION=20100614120000
 #                                                      #
 ########################################################
 IPA_API_VERSION_MAJOR=2
-IPA_API_VERSION_MINOR=32
+IPA_API_VERSION_MINOR=33
diff --git a/ipalib/plugins/cert.py b/ipalib/plugins/cert.py
index 7a3888121b21567d7c3ada0bddb01187aa4bd775..75eace24651b39bac7af7091653afe995b8aff13 100644
--- a/ipalib/plugins/cert.py
+++ b/ipalib/plugins/cert.py
@@ -526,7 +526,7 @@ class cert_revoke(VirtualCommand):
 
     # FIXME: The default is 0.  Is this really an Int param?
     takes_options = (
-        Int('revocation_reason?',
+        Int('revocation_reason',
             label=_('Reason'),
             doc=_('Reason for revoking the certificate (0-10)'),
             minvalue=0,
-- 
1.7.6

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to