daemon: removed utils.validate_ip and shifted tests to test_nodes

This commit is contained in:
Blake Harnden 2020-06-19 15:32:17 -07:00
parent 1829a8e2f8
commit 0d4a360e89
3 changed files with 14 additions and 35 deletions

View file

@ -444,17 +444,3 @@ def validate_mac(value: str) -> str:
return str(mac)
except netaddr.AddrFormatError as e:
raise CoreError(f"invalid mac address {value}: {e}")
def validate_ip(value: str) -> str:
"""
Validate ip address with prefix and return formatted version.
:param value: address to validate
:return: formatted ip address
"""
try:
ip = netaddr.IPNetwork(value)
return str(ip)
except (ValueError, netaddr.AddrFormatError) as e:
raise CoreError(f"invalid ip address {value}: {e}")