import warnings


def get_ip(server, net_type, ip_version):
    """Return the server's IP of the given type and version."""
    warnings.warn('nova_utils.get_ip is deprecated. '
                  'Use self.client_plugin("nova").get_ip')
    if net_type in server.addresses:
        for ip in server.addresses[net_type]:
            if ip['version'] == ip_version:
                return ip['addr']