New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enumerate available options in IPA installer #209
Conversation
|
ping |
|
Hi, we changed a lot of code during refactoring, PR doesn't apply. IMO list of choices shown in --help should be handled in knob() if metavar is not specified and type is choice |
|
@mbasti-rh: |
|
@jcholast I know, but it doesn't fill |
|
@jcholast any update? Should reject this PR and wait for |
|
@mbasti-rh, I don't care as long as it's done right (i.e. without hardcoding |
|
@jcholast @mbasti-rh I will work on modifying |
|
@Akasurde, |
| @@ -179,6 +179,7 @@ def add_options(cls, parser, positional=False): | |||
| elif issubclass(knob_scalar_type, enum.Enum): | |||
| kwargs['type'] = 'choice' | |||
| kwargs['choices'] = [i.value for i in knob_scalar_type] | |||
| kwargs['metavar'] = "[%s]" % ("|".join(kwargs['choices'])) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please use the same format as
argparse:{a,b,c}. str.format()is the preferred way of formatting strings.
| @@ -179,6 +179,8 @@ def add_options(cls, parser, positional=False): | |||
| 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'])) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use , rather than |, as argparse does.
|
Works for me, although you should probably keep the changes to |
| parser.add_option("--ca-signing-algorithm", dest="ca_signing_algorithm", | ||
| type="choice", | ||
| choices=('SHA1withRSA', 'SHA256withRSA', 'SHA512withRSA'), | ||
| type="choice", choices=ca_alogs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: ca_alogs.
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>
|
Fixed upstream |
|
@HonzaCholasta Thanks for your help and reviews. |
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