The error message for adding invalid trust type is not very user friendly:
% ipa trust-add ad.test --type=asdf ipa: ERROR: invalid 'type': must be one of (u'ad',)
The code raises a ValidationError with a message 'only "ad" is supported' but it doesn't appear in the error message above.
Alexander's note:
The message above comes from StrEnum() validator which is common one for all StrEnum()s. I made a ValidationError in execute() method to catch up any discrepancies when other types of trust will be added as Python doesn't have 'case/switch' so you are left alone with 'if' or list-based lambdas which don't look so clear. What we probably want to add is more friendly way to display these StrEnum values, dropping u'' and simply showing proper unicode as we do for help already.
attachment freeipa-mkosek-317-improve-strenum-validation-error-message.patch
Patch freeipa-mkosek-317-improve-strenum-validation-error-message.patch sent for review
master: 988ea36[[BR]] ipa-3-0: a144a4f
Metadata Update from @edewata: - Issue assigned to mkosek - Issue set to the milestone: FreeIPA 3.0 RC2
Login to comment on this ticket.