URL: https://github.com/freeipa/freeipa/pull/209
Author: Akasurde
 Title: #209: Enumerate available options in IPA installer
Action: opened

PR body:
"""
Fix adds enumerated list of available options in IPA server
installer and IPA CA installer help options

Fixes https://fedorahosted.org/freeipa/ticket/5435

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/209/head:pr209
git checkout pr209
From 281f5f90d01c12bcc862ea4124006cfff90fff32 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Wed, 2 Nov 2016 16:36:17 +0530
Subject: [PATCH] Enumerate available options in IPA installer

Fix adds enumerated list of available options in IPA server
installer and IPA CA installer help options

Fixes https://fedorahosted.org/freeipa/ticket/5435

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/tools/ipa-ca-install       | 7 +++++--
 ipaserver/install/server/common.py | 8 ++++++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/install/tools/ipa-ca-install b/install/tools/ipa-ca-install
index 985e741..e34d033 100755
--- a/install/tools/ipa-ca-install
+++ b/install/tools/ipa-ca-install
@@ -61,15 +61,18 @@ def parse_options():
                       default=False, help="unattended installation never prompts the user")
     parser.add_option("--external-ca", dest="external_ca", action="store_true",
                       default=False, help="Generate a CSR to be signed by an external CA")
+    ext_cas = ("generic", "ms-cs")
     parser.add_option("--external-ca-type", dest="external_ca_type",
-                      type="choice", choices=("generic", "ms-cs"),
+                      type="choice", choices=ext_cas,
+                      metavar="{%s}" % "|".join(ext_cas),
                       help="Type of the external CA")
     parser.add_option("--external-cert-file", dest="external_cert_files",
                       action="append", metavar="FILE",
                       help="File containing the IPA CA certificate and the external CA certificate chain")
+    ca_algos = ('SHA1withRSA', 'SHA256withRSA', 'SHA512withRSA')
     parser.add_option("--ca-signing-algorithm", dest="ca_signing_algorithm",
                       type="choice",
-                      choices=('SHA1withRSA', 'SHA256withRSA', 'SHA512withRSA'),
+                      choices=ca_algos, metavar="{%s}" % "|".join(ca_algos),
                       help="Signing algorithm of the IPA CA certificate")
     parser.add_option("-P", "--principal", dest="principal", sensitive=True,
                       default=None, help="User allowed to manage replicas")
diff --git a/ipaserver/install/server/common.py b/ipaserver/install/server/common.py
index e6093d1..57b36a0 100644
--- a/ipaserver/install/server/common.py
+++ b/ipaserver/install/server/common.py
@@ -148,9 +148,11 @@ def subject(self, value):
         except ValueError as e:
             raise ValueError("invalid subject base format: %s" % e)
 
+    ca_algos = {'SHA1withRSA', 'SHA256withRSA', 'SHA512withRSA'}
     ca_signing_algorithm = Knob(
-        {'SHA1withRSA', 'SHA256withRSA', 'SHA512withRSA'}, None,
+        ca_algos, None,
         description="Signing algorithm of the IPA CA certificate",
+        cli_metavar="{%s}" % "|".join(ca_algos)
     )
 
     skip_schema_check = Knob(
@@ -169,9 +171,11 @@ class BaseServerDNS(common.Installable, core.Group, core.Composite):
         cli_name='forwarder',
     )
 
+    forward_policies = {'only', 'first'}
     forward_policy = Knob(
-        {'only', 'first'}, None,
+        forward_policies, None,
         description=("DNS forwarding policy for global forwarders"),
+        cli_metavar="{%s}" % "|".join(forward_policies),
     )
 
     auto_forwarders = Knob(
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to