normalize_ip_address#
- gafaelfawr.util.normalize_ip_address(v)#
Pydantic validator for IP address fields.
Convert the PostgreSQL INET type to
strto support reading entries from a PostgreSQL database.- Parameters:
v (
UnionType[str,IPv4Address,IPv6Address,None]) – The field representing an IP address.- Returns:
The converted IP address.
- Return type:
str or None