mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-27 09:21:59 -06:00
Improve host-add error message
host-add command allows to add a host and its IP address via --ip-address option. When the address is invalid, it throws an error and refuses to operate. However, the invalid IP address error message is always the same which is not right as it forces a user to guess the reason of rejection (loopback address, link-local address or invalid address at all was passed, etc.). This patch changes host-add validator to print the error message. https://fedorahosted.org/freeipa/ticket/2229
This commit is contained in:
parent
092dd8db12
commit
ae2e49a222
@ -203,8 +203,8 @@ def validate_ipaddr(ugettext, ipaddr):
|
||||
"""
|
||||
try:
|
||||
ip = CheckedIPAddress(ipaddr, match_local=False)
|
||||
except:
|
||||
return _('invalid IP address')
|
||||
except Exception, e:
|
||||
return unicode(e)
|
||||
return None
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user