[Freeipa-devel] [PATCH] 317 Improve StrEnum validation error message

Martin Kosek mkosek at redhat.com
Thu Sep 27 12:28:58 UTC 2012


Do not print list of possible values as "%r" but simply as a list
of quoted values which should make it easier to read for users.
Also add a special case when there is just one allowed value.

https://fedorahosted.org/freeipa/ticket/2869


Examples of the improved Enum validation error messages:

# ipa automember-add foo --type=bar
ipa: ERROR: invalid 'type': must be one of 'group', 'hostgroup'

# ipa trust-add foo --type=foo
ipa: ERROR: invalid 'type': must be 'ad'

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-mkosek-317-improve-strenum-validation-error-message.patch
Type: text/x-patch
Size: 3336 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20120927/a7979a37/attachment.bin>


More information about the Freeipa-devel mailing list