summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhijeet Kasurde <akasurde@redhat.com>2016-11-02 16:36:17 +0530
committerJan Cholasta <jcholast@redhat.com>2017-01-03 13:00:36 +0100
commit80c0e5cb8d689cf1ec6a883d2c7000f9dadbf7d8 (patch)
treee44f5311a48985340c13ccb212c7d29fa5513dfd
parenteb1f05d598d821f8e7eb5b8cfe606f570052f263 (diff)
downloadfreeipa-80c0e5cb8d689cf1ec6a883d2c7000f9dadbf7d8.tar.gz
freeipa-80c0e5cb8d689cf1ec6a883d2c7000f9dadbf7d8.tar.xz
freeipa-80c0e5cb8d689cf1ec6a883d2c7000f9dadbf7d8.zip
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 <akasurde@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
-rwxr-xr-xinstall/tools/ipa-ca-install9
-rw-r--r--ipapython/install/cli.py2
2 files changed, 8 insertions, 3 deletions
diff --git a/install/tools/ipa-ca-install b/install/tools/ipa-ca-install
index 88939f9db..ca909a005 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="{{{0}}}".format(",".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'),
+ type="choice", choices=ca_algos,
+ metavar="{{{0}}}".format(",".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/ipapython/install/cli.py b/ipapython/install/cli.py
index b6f872ed9..441c875f6 100644
--- a/ipapython/install/cli.py
+++ b/ipapython/install/cli.py
@@ -179,6 +179,8 @@ class ConfigureTool(admintool.AdminTool):
elif issubclass(knob_scalar_type, enum.Enum):
kwargs['type'] = 'choice'
kwargs['choices'] = [i.value for i in knob_scalar_type]
+ kwargs['metavar'] = "{{{0}}}".format(
+ ",".join(kwargs['choices']))
else:
kwargs['nargs'] = 1
kwargs['callback_args'] = (knob_scalar_type,)