Returns True if the given addr is valid OVSDB server address, otherwise
    False.

    The valid formats are:

    - ``unix:file``
    - ``tcp:ip:port``
    - ``ssl:ip:port``

    If ip is IPv6 address, wrap ip with brackets (e.g., ssl:[::1]:6640).

    :param addr: str value of OVSDB server address.
    :return: True if valid, otherwise False.

def valid_ovsdb_addr(addr):
    """
    Returns True if the given addr is valid OVSDB server address, otherwise
    False.

    The valid formats are:

    - ``unix:file``
    - ``tcp:ip:port``
    - ``ssl:ip:port``

    If ip is IPv6 address, wrap ip with brackets (e.g., ssl:[::1]:6640).

    :param addr: str value of OVSDB server address.
    :return: True if valid, otherwise False.
    """
    # Assumes Unix socket format: "unix:file"
    m = re.match(r'unix:(\S+)', addr)
    if m:
        file = m.group(1)
        return os.path.isfile(file)
    # Assumes TCP/SSL socket format: "tcp:ip:port" or "ssl:ip:port"
    m = re.match(r'(tcp|ssl):(\S+):(\d+)', addr)
    if m:
        address = m.group(2)
        port = m.group(3)
        if '[' in address:
            address = address.strip('[').strip(']')
            return ip.valid_ipv6(address) and port.isdigit()
        else:
            return ip.valid_ipv4(address) and port.isdigit()
    # Assumes invalid format or unsupported type
    return False