mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-11 08:41:55 -06:00
Show error message for invalid IPs in client install
Re-raise the thrown exception to get an error message instead of a traceback during ipa-client-install with invalid IP address. https://fedorahosted.org/freeipa/ticket/6340 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
This commit is contained in:
parent
8f8e3d008f
commit
ddf48f2fef
@ -133,8 +133,11 @@ class CheckedIPAddress(UnsafeIPAddress):
|
||||
"""
|
||||
def __init__(self, addr, match_local=False, parse_netmask=True,
|
||||
allow_loopback=False, allow_multicast=False):
|
||||
try:
|
||||
super(CheckedIPAddress, self).__init__(addr)
|
||||
except netaddr.core.AddrFormatError as e:
|
||||
raise ValueError(e)
|
||||
|
||||
super(CheckedIPAddress, self).__init__(addr)
|
||||
if isinstance(addr, CheckedIPAddress):
|
||||
self.prefixlen = addr.prefixlen
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user