#1549 Error message states 'automountmapautomountmapname' while add/mod/del automountkey with empty automountmap name.
Closed: Fixed None Opened 10 years ago by rcritten.

https://bugzilla.redhat.com/show_bug.cgi?id=726725

As part of negative testing when I add/delete/mod/show/find a automountkey with
empty automountmap name I see the error message as 'automountmapautomountmapname'.

[root@bumblebee auto]# ipa automountkey-add pune 
Map: 
ipa: ERROR: 'automountmapautomountmapname' is required
[root@bumblebee auto]# ipa automountkey-del pune 
Map: 
ipa: ERROR: 'automountmapautomountmapname' is required
[root@bumblebee auto]# ipa automountkey-mod pune 
Map: 
ipa: ERROR: 'automountmapautomountmapname' is required
[root@bumblebee auto]# ipa automountkey-find pune 
Map: 
ipa: ERROR: 'automountmapautomountmapname' is required
[root@bumblebee auto]# ipa automountkey-show pune 
Map: 
ipa: ERROR: 'automountmapautomountmapname' is required
[root@bumblebee auto]#

Accepting ticket. It looks like generic issue with the way parameters are treated in hierarchical objects. When RequirementError is raised in validate(), it uses self.cli_name or self.name of the parameter. For inherited parameters the string passed to RequirementError constructor should be defined a bit smarter -- after all, it is used later only for visualization purposes.

Debugged a bit further. This happens due to the fact that parameters don't have context set in their environment (i.e. self.env.context is None), therefore RequirementError gets self.name instead of self.cli_name.

Patch is posted to freeipa-devel@ for discussion.

There are several concerns on scale of changes needed. Though original issues are in error messages, the change would affect all IPA framework which means we need more time to work through all consequences. Moving to 2.1.1.

Updated patch posted for review.

Metadata Update from @rcritten:
- Issue assigned to abbra
- Issue set to the milestone: FreeIPA 2.1.1 (bug fixing)

5 years ago

Login to comment on this ticket.

Metadata