better error for IP like 192.168.001.1 => 192.168.1.1
This commit is contained in:
parent
2d7729612b
commit
2f125cfc8c
|
@ -62,7 +62,9 @@ class IPOption(StrOption):
|
|||
|
||||
def _validate_ip(self, value):
|
||||
try:
|
||||
ip_address(value)
|
||||
new_value = str(ip_address(value))
|
||||
if value != new_value:
|
||||
raise ValueError(f'should be {new_value}')
|
||||
except ValueError:
|
||||
raise ValueError()
|
||||
|
||||
|
|
Loading…
Reference in New Issue